Fix hotkey checks and settings UI

This commit is contained in:
Beingpax 2025-07-02 09:15:29 +05:45
parent 3e609d1e3b
commit ccfc077cc1
4 changed files with 5 additions and 4 deletions

View File

@ -168,7 +168,7 @@ struct ContentView: View {
private var isSetupComplete: Bool {
hasLoadedData &&
whisperState.currentTranscriptionModel != nil &&
KeyboardShortcuts.getShortcut(for: .toggleMiniRecorder) != nil &&
hotkeyManager.selectedHotkey1 != .none &&
AXIsProcessTrusted() &&
CGPreflightScreenCaptureAccess()
}

View File

@ -69,7 +69,7 @@ struct MetricsView: View {
private var isSetupComplete: Bool {
hasLoadedData &&
whisperState.currentTranscriptionModel != nil &&
KeyboardShortcuts.getShortcut(for: .toggleMiniRecorder) != nil &&
hotkeyManager.selectedHotkey1 != .none &&
AXIsProcessTrusted() &&
CGPreflightScreenCaptureAccess()
}

View File

@ -183,6 +183,7 @@ struct PermissionCard: View {
}
struct PermissionsView: View {
@EnvironmentObject private var hotkeyManager: HotkeyManager
@StateObject private var permissionManager = PermissionManager()
var body: some View {
@ -216,7 +217,7 @@ struct PermissionsView: View {
icon: "keyboard",
title: "Keyboard Shortcut",
description: "Set up a keyboard shortcut to use VoiceInk anywhere",
isGranted: permissionManager.isKeyboardShortcutSet,
isGranted: hotkeyManager.selectedHotkey1 != .none,
buttonTitle: "Configure Shortcut",
buttonAction: {
NotificationCenter.default.post(

View File

@ -48,7 +48,7 @@ struct SettingsView: View {
}
// "Add another hotkey" button
if hotkeyManager.selectedHotkey2 == .none {
if hotkeyManager.selectedHotkey1 != .none && hotkeyManager.selectedHotkey2 == .none {
HStack {
Spacer()
Button(action: {