Skip to content

Commit

Permalink
chore: prompt user to restart application when missing AX perms
Browse files Browse the repository at this point in the history
  • Loading branch information
ejbills committed Jan 3, 2025
1 parent 6320e54 commit bb07c1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions DockDoor/Utilities/DockObserver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ final class DockObserver {
guard AXIsProcessTrusted() else {
MessageUtil.showAlert(
title: "Accessibility Permissions Required",
message: "Please enable accessibility permissions in System Preferences > Security & Privacy > Privacy > Accessibility.",
actions: [.ok]
message: "You need to enable accessibility permissions for DockDoor to function, click OK to open System Preferences. A restart is required after granting permissions.",
actions: [.ok, .cancel],
completion: { _ in
SystemPreferencesHelper.openAccessibilityPreferences()
askUserToRestartApplication()
}
)
return
}
Expand Down
4 changes: 3 additions & 1 deletion DockDoor/Utilities/MessageUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ enum MessageUtil {
actions.last ?? .cancel
}

completion?(buttonAction)
if buttonAction != .cancel {
completion?(buttonAction)
}
}
}

0 comments on commit bb07c1f

Please sign in to comment.