Ariver
2026-05-24 5e35c24a9306b8030b39bfb68abde5e625f7900b
Apptag/AppDefaults.swift
@@ -2,7 +2,7 @@
enum AppDefaults {
    static let schemaVersionKey = "initialDefaultsSchemaVersion"
    static let currentSchemaVersion = 1
    static let currentSchemaVersion = 3
    static let tagFontSize: Double = 22
    static let iconSize: Double = 80
@@ -22,12 +22,30 @@
            "hideAppNames": hideAppNames,
            "showDockIcon": showDockIcon,
            "launchAtLogin": launchAtLogin,
            "showUncommonAppBubbles": showUncommonAppBubbles
            "showUncommonAppBubbles": showUncommonAppBubbles,
            LauncherHotkeyRegistrationStore.mainStateKey: LauncherHotkeyRegistrationState.active.rawValue,
            LauncherHotkeyRegistrationStore.quickSearchStateKey: LauncherHotkeyRegistrationState.active.rawValue
        ])
        removeShortcutCustomizationDefaults()
    }
    static func hasStoredValue(for key: String) -> Bool {
        let domain = Bundle.main.bundleIdentifier ?? "com.apptag.launcher"
        let domain = Bundle.main.bundleIdentifier ?? AppIdentity.bundleIdentifier
        return UserDefaults.standard.persistentDomain(forName: domain)?[key] != nil
    }
    private static func removeShortcutCustomizationDefaults() {
        let defaults = UserDefaults.standard
        [
            "mainHotkey",
            "quickSearchHotkey",
            "mainHotkeyPending",
            "quickSearchHotkeyPending",
            "mainHotkeyStatus",
            "quickSearchHotkeyStatus",
            "mainHotkeyConflictMessage",
            "quickSearchHotkeyConflictMessage"
        ].forEach { defaults.removeObject(forKey: $0) }
        defaults.set(currentSchemaVersion, forKey: schemaVersionKey)
    }
}