patch
This commit is contained in:
parent
dd61970357
commit
43a9d477a9
@ -86,10 +86,10 @@ final class AppUpdateChecker: ObservableObject {
|
||||
log("Config missing App Store URL")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
print("buildNumber", buildNumber)
|
||||
print("config", config.notSupportedBuild, config.minSupportedBuild, config.recommendedBuild)
|
||||
|
||||
let requiresDoUpdate = buildNumber <= config.notSupportedBuild
|
||||
if requiresDoUpdate, let info = config.forceUpdate {
|
||||
forceUpdateNotice = AppUpdateNotice(kind: .force, title: info.title, message: info.message, appStoreURL: appStoreURL)
|
||||
@ -124,17 +124,10 @@ final class AppUpdateChecker: ObservableObject {
|
||||
}
|
||||
|
||||
private struct RemoteBuildConfiguration: Decodable {
|
||||
struct UpdateInfo: Decodable {
|
||||
let title: String
|
||||
let message: String
|
||||
}
|
||||
|
||||
let schemaVersion: Int
|
||||
let notSupportedBuild: Int
|
||||
let minSupportedBuild: Int
|
||||
let recommendedBuild: Int
|
||||
let forceUpdate: UpdateInfo?
|
||||
let softUpdate: UpdateInfo?
|
||||
let appStoreURL: URL?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
@ -153,8 +146,6 @@ private struct RemoteBuildConfiguration: Decodable {
|
||||
notSupportedBuild = try container.decode(Int.self, forKey: .notSupportedBuild)
|
||||
minSupportedBuild = try container.decode(Int.self, forKey: .minSupportedBuild)
|
||||
recommendedBuild = try container.decode(Int.self, forKey: .recommendedBuild)
|
||||
forceUpdate = try container.decodeIfPresent(UpdateInfo.self, forKey: .forceUpdate)
|
||||
softUpdate = try container.decodeIfPresent(UpdateInfo.self, forKey: .softUpdate)
|
||||
if let urlString = try container.decodeIfPresent(String.self, forKey: .appStoreURL) {
|
||||
appStoreURL = URL(string: urlString)
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user