mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-08-26 23:20:57 +00:00
* Slim package * Cleanup * . * Expose tokenID. * Expose some constants. * Open. * Combine cleanup * Make eraser base public. * Reload * Fix concurrency issue on key insertion. * Add capabilities. * . * Revert "." This reverts commit7c5c2924fa
. * Revert "Add capabilities." This reverts commitbfa7a3cd51
.
34 lines
807 B
Swift
34 lines
807 B
Swift
import Foundation
|
|
import AppKit
|
|
|
|
protocol JustUpdatedCheckerProtocol: Observable {
|
|
var justUpdated: Bool { get }
|
|
}
|
|
|
|
@Observable class JustUpdatedChecker: JustUpdatedCheckerProtocol {
|
|
|
|
var justUpdated: Bool = false
|
|
|
|
init() {
|
|
check()
|
|
}
|
|
|
|
func check() {
|
|
let lastBuild = UserDefaults.standard.object(forKey: Constants.previousVersionUserDefaultsKey) as? String ?? "None"
|
|
let currentBuild = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String
|
|
UserDefaults.standard.set(currentBuild, forKey: Constants.previousVersionUserDefaultsKey)
|
|
justUpdated = lastBuild != currentBuild
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
extension JustUpdatedChecker {
|
|
|
|
enum Constants {
|
|
static let previousVersionUserDefaultsKey = "com.maxgoedjen.Secretive.lastBuild"
|
|
}
|
|
|
|
}
|