Fix hotkey checks and settings UI
This commit is contained in:
parent
3e609d1e3b
commit
ccfc077cc1
@ -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()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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(
|
||||||
|
|||||||
@ -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: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user