1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-10 00:58:37 +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: [])
static var blacklistedAppIds: [String]
@UserDefault(key: "com.toxblh.mtmr.dock.persistent", defaultValue: [])
static var dockPersistentAppIds: [String]
}
@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.didActivateApplicationNotification, object: nil)
if let persistent = UserDefaults.standard.stringArray(forKey: "com.toxblh.mtmr.dock.persistent") {
persistentAppIdentifiers = persistent
}
persistentAppIdentifiers = AppSettings.dockPersistentAppIds
updateRunningApplication()
}
@ -208,8 +205,7 @@ class AppScrubberTouchBarItem: NSCustomTouchBarItem, NSScrubberDelegate, NSScrub
persistentAppIdentifiers.append(bundleIdentifier!)
}
UserDefaults.standard.set(persistentAppIdentifiers, forKey: "com.toxblh.mtmr.dock.persistent")
UserDefaults.standard.synchronize()
AppSettings.dockPersistentAppIds = persistentAppIdentifiers
}
ticks = 0
updateRunningApplication()