Skip to content

Commit 12f0833

Browse files
committed
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.
1 parent 45be10b commit 12f0833

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mac/Sources/CodeBurnMenubar/Data/UpdateChecker.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ final class UpdateChecker {
1818
let current = currentVersion
1919
let normalizedLatest = latest.hasPrefix("v") ? String(latest.dropFirst()) : latest
2020
let normalizedCurrent = current.hasPrefix("v") ? String(current.dropFirst()) : current
21-
return !normalizedCurrent.isEmpty && normalizedCurrent != "dev" && normalizedLatest != normalizedCurrent
21+
guard !normalizedCurrent.isEmpty && normalizedCurrent != "dev" else { return false }
22+
return normalizedLatest.compare(normalizedCurrent, options: .numeric) == .orderedDescending
2223
}
2324

2425
var currentVersion: String {

0 commit comments

Comments
 (0)