Use keychain instead of UserDefaults in JustUpdatedChecker.swift

This commit is contained in:
Paul Heidekrüger 2024-02-29 19:55:20 +01:00
parent 2a58323706
commit 70cfdf8327

View File

@ -15,14 +15,11 @@ class JustUpdatedChecker: ObservableObject, JustUpdatedCheckerProtocol {
} }
func check() { func check() {
let lastBuild = UserDefaults.standard.object(forKey: Constants.previousVersionUserDefaultsKey) as? String ?? "None" let lastBuild = SettingsStore.get(key: Constants.previousVersionUserDefaultsKey) ?? "None"
let currentBuild = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String let currentBuild = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String
UserDefaults.standard.set(currentBuild, forKey: Constants.previousVersionUserDefaultsKey) SettingsStore.set(key: Constants.previousVersionUserDefaultsKey, value: currentBuild)
justUpdated = lastBuild != currentBuild justUpdated = lastBuild != currentBuild
} }
} }
extension JustUpdatedChecker { extension JustUpdatedChecker {