fix: app could sometimes crash on closing the ui
This commit is contained in:
1 parent
5f828f61b3
commit
61db5b4fb6
1 file changed
+3
-2
@@ -80,13 +80,14 @@ class GeneralTab: NSViewController, PreferencePane {
|
||||
App.app.appIsBeingUsed = true
|
||||
}
|
||||
if App.app.appIsBeingUsed {
|
||||
let isShortcutClosingTheUi = controlId == "holdShortcut"
|
||||
let isShortcutClosingTheUi = ["holdShortcut", "cancelShortcut"].contains(controlId)
|
||||
if isShortcutClosingTheUi {
|
||||
App.app.appIsBeingUsed = false
|
||||
App.app.isFirstSummon = true
|
||||
}
|
||||
let fn = shortcutsActionsBlocks[controlId]!
|
||||
let isShortcutAffectingTheUi = ["previousWindowShortcut", "nextWindowShortcut", "←", "→", "holdShortcut"].contains(controlId)
|
||||
if isShortcutAffectingTheUi {
|
||||
if isShortcutAffectingTheUi || isShortcutClosingTheUi {
|
||||
DispatchQueue.main.async { () -> () in fn() }
|
||||
} else {
|
||||
fn()
|
||||
|
||||
Reference in new issue
Block a user