From 43a9d477a90874f2a64aaaa6ff84433bc63c1fe0 Mon Sep 17 00:00:00 2001 From: cheykrym Date: Thu, 18 Dec 2025 02:46:12 +0300 Subject: [PATCH] patch --- yobble/Services/AppUpdateChecker.swift | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/yobble/Services/AppUpdateChecker.swift b/yobble/Services/AppUpdateChecker.swift index 25c89cb..ee69cda 100644 --- a/yobble/Services/AppUpdateChecker.swift +++ b/yobble/Services/AppUpdateChecker.swift @@ -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 {