mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-05-05 02:16:44 +00:00
fix(menubar): use numeric version comparison for update check
Compare versions with .orderedDescending instead of != to prevent showing update button when installed version is newer than cached.
This commit is contained in:
parent
45be10b755
commit
12f0833bef
1 changed files with 2 additions and 1 deletions
|
|
@ -18,7 +18,8 @@ final class UpdateChecker {
|
|||
let current = currentVersion
|
||||
let normalizedLatest = latest.hasPrefix("v") ? String(latest.dropFirst()) : latest
|
||||
let normalizedCurrent = current.hasPrefix("v") ? String(current.dropFirst()) : current
|
||||
return !normalizedCurrent.isEmpty && normalizedCurrent != "dev" && normalizedLatest != normalizedCurrent
|
||||
guard !normalizedCurrent.isEmpty && normalizedCurrent != "dev" else { return false }
|
||||
return normalizedLatest.compare(normalizedCurrent, options: .numeric) == .orderedDescending
|
||||
}
|
||||
|
||||
var currentVersion: String {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue