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) await ActiveWindowService.shared.applyConfiguration(selectedConfig)
} }
} else { } else {
guard let enhancementService = await self.whisperState.getEnhancementService(), guard let enhancementService = await self.whisperState.getEnhancementService() else { return }
enhancementService.isEnhancementEnabled else { return }
let availablePrompts = enhancementService.allPrompts let availablePrompts = enhancementService.allPrompts
if index < availablePrompts.count { if index < availablePrompts.count {
if !enhancementService.isEnhancementEnabled {
enhancementService.isEnhancementEnabled = true
}
enhancementService.setActivePrompt(availablePrompts[index]) enhancementService.setActivePrompt(availablePrompts[index])
} }
} }

View File

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