From 9db0b4f55f7490438d84bbead8422dda37df6884 Mon Sep 17 00:00:00 2001 From: Kiara <68660034+DragonCat4012@users.noreply.github.com> Date: Sat, 6 Jan 2024 15:37:15 +0100 Subject: [PATCH] refactor whatsnew popup ig --- Calq/lib/Util/Util.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Calq/lib/Util/Util.swift b/Calq/lib/Util/Util.swift index 9e3421a..0dad577 100644 --- a/Calq/lib/Util/Util.swift +++ b/Calq/lib/Util/Util.swift @@ -243,8 +243,12 @@ struct Util { } static func checkIfNewVersion() -> Bool { - let oldVersion = UserDefaults.standard.string(forKey: UD_lastVersion) ?? "0.0.0" - if oldVersion == "0.0.0" { return true } + let oldVersion = UserDefaults.standard.string(forKey: UD_lastVersion) + + guard let oldVersion = oldVersion else { + return true + } + let partsOldV = oldVersion.split(separator: ".") let partsNewV = appVersion.split(separator: ".")