fix: apply hotkey changes immediately, reset stuck window session, retry hotkey after permission grant
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -160,12 +160,17 @@ final class AppModel: ObservableObject {
|
|||||||
hotkey.binding = hotkeyBinding
|
hotkey.binding = hotkeyBinding
|
||||||
|
|
||||||
settings.$hotkeyID
|
settings.$hotkeyID
|
||||||
.sink { [weak self] _ in
|
.sink { [weak self] id in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
self.hotkey.binding = self.hotkeyBinding
|
self.hotkey.binding = HotkeyBinding.binding(id: id) ?? .fn
|
||||||
self.objectWillChange.send()
|
self.objectWillChange.send()
|
||||||
}
|
}
|
||||||
.store(in: &cancellables)
|
.store(in: &cancellables)
|
||||||
|
permissions.$inputMonitoring
|
||||||
|
.removeDuplicates()
|
||||||
|
.filter { $0 }
|
||||||
|
.sink { [weak self] _ in self?.retryHotkey() }
|
||||||
|
.store(in: &cancellables)
|
||||||
settings.$useCorrection
|
settings.$useCorrection
|
||||||
.sink { [corrector] in corrector.setEnabled($0) }
|
.sink { [corrector] in corrector.setEnabled($0) }
|
||||||
.store(in: &cancellables)
|
.store(in: &cancellables)
|
||||||
@@ -228,7 +233,10 @@ final class AppModel: ObservableObject {
|
|||||||
func startWindowRecording() {
|
func startWindowRecording() {
|
||||||
guard recordingBlocker == nil, state == .idle else { return }
|
guard recordingBlocker == nil, state == .idle else { return }
|
||||||
policy.windowSession = true
|
policy.windowSession = true
|
||||||
Task { await controller.handle(.pressed) }
|
Task {
|
||||||
|
await controller.handle(.pressed)
|
||||||
|
if state != .recording { policy.windowSession = false }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func stopWindowRecording() {
|
func stopWindowRecording() {
|
||||||
|
|||||||
Reference in New Issue
Block a user