refactor: centralize shortcut recording lifetime

This commit is contained in:
Valdemar Lorenzen
2026-10-16 10:23:20 +02:00
parent 04e505b846
commit 6725be8ad5
7 changed files with 199 additions and 30 deletions
@@ -33,7 +33,7 @@ func duplicateGlobalBindingIsRejectedWhileSuspendedWithoutChangingSavedBinding()
defaults.set(candidate.storedValue, forKey: "globalActivationShortcut")
defaults.set(previous.storedValue, forKey: "globalCommandShortcut.emoji")
let shortcuts = GlobalShortcuts(defaults: defaults) { _ in }
shortcuts.suspend()
shortcuts.beginRecording()
do {
try shortcuts.setShortcut(candidate, at: emojiIndex)