feat: configure launcher color scheme
This commit is contained in:
@@ -108,7 +108,7 @@ private final class ApplicationDelegate: NSObject, NSApplicationDelegate {
|
||||
controller.retryUninstallRecovery = { [uninstaller] in await uninstaller.recover() }
|
||||
return controller
|
||||
}
|
||||
private var startupShortcutError: String?
|
||||
private var startupError = ThemePalette.configurationError
|
||||
private var startupRecoveryMessage: String?
|
||||
|
||||
private var isLoginLaunch: Bool {
|
||||
@@ -137,24 +137,23 @@ private final class ApplicationDelegate: NSObject, NSApplicationDelegate {
|
||||
launcher.present()
|
||||
}
|
||||
let shortcutErrors = shortcuts.start()
|
||||
if !shortcutErrors.isEmpty {
|
||||
startupShortcutError = shortcutErrors.joined(separator: "\n")
|
||||
if !isLoginLaunch { showSettings(nil) }
|
||||
}
|
||||
startupError = ([startupError].compactMap { $0 } + shortcutErrors).joined(separator: "\n")
|
||||
if startupError?.isEmpty == true { startupError = nil }
|
||||
if startupError != nil && !loginLaunch { showSettings(nil) }
|
||||
}
|
||||
|
||||
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows: Bool) -> Bool {
|
||||
guard !isLoginLaunch else { return false }
|
||||
launcher.present()
|
||||
if startupShortcutError != nil || startupRecoveryMessage != nil {
|
||||
if startupError != nil || startupRecoveryMessage != nil {
|
||||
showSettings(nil)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@objc func showSettings(_ sender: Any?) {
|
||||
settings.present(error: startupShortcutError)
|
||||
startupShortcutError = nil
|
||||
settings.present(error: startupError)
|
||||
startupError = nil
|
||||
startupRecoveryMessage = nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user