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:
parent
b155cac2b0
commit
94717a5ea3
@ -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
|
||||||
|
|||||||
@ -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()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user