fix(updates): harden Sparkle release metadata

This commit is contained in:
nimbold
2026-06-06 15:54:44 +03:30
parent 6a20250d22
commit 09cea67041
4 changed files with 32 additions and 3 deletions
+13 -1
View File
@@ -15,10 +15,16 @@ final class SparkleUpdater: NSObject, ObservableObject, SPUUpdaterDelegate {
}
func checkForUpdates() {
guard controller.updater.canCheckForUpdates else {
isChecking = false
updateStatus = "Update check is already in progress."
return
}
isChecking = true
updateStatus = "Checking for updates..."
foundUpdateItem = nil
controller.updater.checkForUpdatesInBackground()
controller.checkForUpdates(nil)
}
func updater(_ updater: SPUUpdater, didFindValidUpdate item: SUAppcastItem) {
@@ -48,6 +54,12 @@ final class SparkleUpdater: NSObject, ObservableObject, SPUUpdaterDelegate {
self.updateStatus = "Update check failed: \(error.localizedDescription)"
}
}
func updater(_ updater: SPUUpdater, didFinishUpdateCycleFor updateCheck: SPUUpdateCheck, error: Error?) {
DispatchQueue.main.async {
self.isChecking = false
}
}
}
@main