mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-06 17:38:06 +00:00
fix(updates): harden Sparkle release metadata
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user