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 { private var isSetupComplete: Bool {
hasLoadedData && hasLoadedData &&
whisperState.currentTranscriptionModel != nil && whisperState.currentTranscriptionModel != nil &&
KeyboardShortcuts.getShortcut(for: .toggleMiniRecorder) != nil && hotkeyManager.selectedHotkey1 != .none &&
AXIsProcessTrusted() && AXIsProcessTrusted() &&
CGPreflightScreenCaptureAccess() CGPreflightScreenCaptureAccess()
} }

View File

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

View File

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

View File

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