1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-11 17:38:38 +00:00

missed a single userdefaults

This commit is contained in:
Serg 2019-10-26 17:22:19 +07:00
parent b155cac2b0
commit 94717a5ea3
2 changed files with 5 additions and 6 deletions

View File

@ -12,6 +12,9 @@ struct AppSettings {
@UserDefault(key: "com.toxblh.mtmr.blackListedApps", defaultValue: []) @UserDefault(key: "com.toxblh.mtmr.blackListedApps", defaultValue: [])
static var blacklistedAppIds: [String] static var blacklistedAppIds: [String]
@UserDefault(key: "com.toxblh.mtmr.dock.persistent", defaultValue: [])
static var dockPersistentAppIds: [String]
} }
@propertyWrapper @propertyWrapper

View File

@ -58,10 +58,7 @@ class AppScrubberTouchBarItem: NSCustomTouchBarItem, NSScrubberDelegate, NSScrub
NSWorkspace.shared.notificationCenter.addObserver(self, selector: #selector(activeApplicationChanged), name: NSWorkspace.didTerminateApplicationNotification, object: nil) NSWorkspace.shared.notificationCenter.addObserver(self, selector: #selector(activeApplicationChanged), name: NSWorkspace.didTerminateApplicationNotification, object: nil)
NSWorkspace.shared.notificationCenter.addObserver(self, selector: #selector(activeApplicationChanged), name: NSWorkspace.didActivateApplicationNotification, object: nil) NSWorkspace.shared.notificationCenter.addObserver(self, selector: #selector(activeApplicationChanged), name: NSWorkspace.didActivateApplicationNotification, object: nil)
if let persistent = UserDefaults.standard.stringArray(forKey: "com.toxblh.mtmr.dock.persistent") { persistentAppIdentifiers = AppSettings.dockPersistentAppIds
persistentAppIdentifiers = persistent
}
updateRunningApplication() updateRunningApplication()
} }
@ -208,8 +205,7 @@ class AppScrubberTouchBarItem: NSCustomTouchBarItem, NSScrubberDelegate, NSScrub
persistentAppIdentifiers.append(bundleIdentifier!) persistentAppIdentifiers.append(bundleIdentifier!)
} }
UserDefaults.standard.set(persistentAppIdentifiers, forKey: "com.toxblh.mtmr.dock.persistent") AppSettings.dockPersistentAppIds = persistentAppIdentifiers
UserDefaults.standard.synchronize()
} }
ticks = 0 ticks = 0
updateRunningApplication() updateRunningApplication()