Reset recording state on app launch
This commit is contained in:
parent
dc3355b91c
commit
8f0b344721
@ -84,6 +84,11 @@ struct VoiceInkApp: App {
|
||||
activeWindowService.configureWhisperState(whisperState)
|
||||
_activeWindowService = StateObject(wrappedValue: activeWindowService)
|
||||
|
||||
// Ensure no lingering recording state from previous runs
|
||||
Task {
|
||||
await whisperState.resetOnLaunch()
|
||||
}
|
||||
|
||||
AppShortcuts.updateAppShortcutParameters()
|
||||
}
|
||||
|
||||
|
||||
@ -80,6 +80,19 @@ extension WhisperState {
|
||||
}
|
||||
}
|
||||
|
||||
func resetOnLaunch() async {
|
||||
logger.notice("🔄 Resetting recording state on launch")
|
||||
await recorder.stopRecording()
|
||||
hideRecorderPanel()
|
||||
await MainActor.run {
|
||||
isMiniRecorderVisible = false
|
||||
shouldCancelRecording = false
|
||||
miniRecorderError = nil
|
||||
recordingState = .idle
|
||||
}
|
||||
await cleanupModelResources()
|
||||
}
|
||||
|
||||
func cancelRecording() async {
|
||||
SoundManager.shared.playEscSound()
|
||||
shouldCancelRecording = true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user