Fix prompt popover keyboard shortcuts

This commit is contained in:
Beingpax 2025-06-23 10:24:23 +05:45
parent b8899bf0b7
commit 17c2ca4e2e
2 changed files with 8 additions and 2 deletions

View File

@ -316,11 +316,14 @@ class HotkeyManager: ObservableObject {
await ActiveWindowService.shared.applyConfiguration(selectedConfig)
}
} else {
guard let enhancementService = await self.whisperState.getEnhancementService(),
enhancementService.isEnhancementEnabled else { return }
guard let enhancementService = await self.whisperState.getEnhancementService() else { return }
let availablePrompts = enhancementService.allPrompts
if index < availablePrompts.count {
if !enhancementService.isEnhancementEnabled {
enhancementService.isEnhancementEnabled = true
}
enhancementService.setActivePrompt(availablePrompts[index])
}
}

View File

@ -49,6 +49,9 @@ struct EnhancementPromptPopover: View {
// Set the initially selected prompt
selectedPrompt = enhancementService.activePrompt
}
.onChange(of: enhancementService.selectedPromptId) { oldValue, newValue in
selectedPrompt = enhancementService.activePrompt
}
}
}