Update SecureStorageSample

This commit is contained in:
Matt Bruce 2026-01-16 21:58:41 -06:00
parent 6d5c916f95
commit dcc6ea6f6b
3 changed files with 29 additions and 29 deletions

View File

@ -6,31 +6,31 @@ import SharedKit
struct AppStorageCatalog: StorageKeyCatalog { struct AppStorageCatalog: StorageKeyCatalog {
var allKeys: [AnyStorageKey] { var allKeys: [AnyStorageKey] {
[ [
.key(StorageKey.appVersion), .key(.appVersion),
.key(StorageKey.userPreferences), .key(.userPreferences),
.key(StorageKey.credentials), .key(.credentials),
.key(StorageKey.lastLocation), .key(.lastLocation),
.key(StorageKey.apiToken), .key(.apiToken),
.key(StorageKey.userProfileFile), .key(.userProfileFile),
.key(StorageKey.cachedData), .key(.cachedData),
.key(StorageKey.settingsPlist), .key(.settingsPlist),
.key(StorageKey.sessionLogs), .key(.sessionLogs),
.key(StorageKey.privateNotes), .key(.privateNotes),
.key(StorageKey.externalSessionLogs), .key(.externalSessionLogs),
.key(StorageKey.watchVibration), .key(.watchVibration),
.key(StorageKey.syncableSetting), .key(.syncableSetting),
.key(StorageKey.externalKeyMaterial), .key(.externalKeyMaterial),
.key(StorageKey.appGroupUserDefaults), .key(.appGroupUserDefaults),
.key(StorageKey.appGroupUserProfile), .key(.appGroupUserProfile),
.key(StorageKey.legacyMigrationSource), .key(.legacyMigrationSource),
.key(StorageKey.modernMigrationDestination), .key(.modernMigrationDestination),
.key(StorageKey.legacyProfileName), .key(.legacyProfileName),
.key(StorageKey.modernProfileName), .key(.modernProfileName),
.key(StorageKey.legacyNotificationSetting), .key(.legacyNotificationSetting),
.key(StorageKey.legacyThemeSetting), .key(.legacyThemeSetting),
.key(StorageKey.modernUnifiedSettings), .key(.modernUnifiedSettings),
.key(StorageKey.legacyAppMode), .key(.legacyAppMode),
.key(StorageKey.modernAppMode) .key(.modernAppMode)
] ]
} }
} }

View File

@ -28,6 +28,7 @@ extension StorageKey where Value == String {
} }
extension StorageKey where Value == UnifiedSettings { extension StorageKey where Value == UnifiedSettings {
nonisolated static let modernUnifiedSettings = StorageKey( nonisolated static let modernUnifiedSettings = StorageKey(
name: "modern_unified_settings", name: "modern_unified_settings",
domain: .fileSystem(directory: .documents), domain: .fileSystem(directory: .documents),
@ -39,10 +40,9 @@ extension StorageKey where Value == UnifiedSettings {
syncPolicy: .never, syncPolicy: .never,
migration: { key in migration: { key in
let sources: [AnyStorageKey] = [ let sources: [AnyStorageKey] = [
.key(StorageKey<Bool>.legacyNotificationSetting), .key(.legacyNotificationSetting),
.key(StorageKey<String>.legacyThemeSetting) .key(.legacyThemeSetting)
] ]
return AnyStorageMigration( return AnyStorageMigration(
DefaultAggregatingMigration( DefaultAggregatingMigration(
destinationKey: key, destinationKey: key,

View File

@ -31,7 +31,7 @@ extension StorageKey where Value == String {
AnyStorageMigration( AnyStorageMigration(
SimpleLegacyMigration( SimpleLegacyMigration(
destinationKey: key, destinationKey: key,
sourceKey: .key(StorageKey.legacyMigrationSource) sourceKey: .key(.legacyMigrationSource)
) )
) )
} }