mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-29 03:57:11 +00:00
feat(updater): upgrade sparkle to 2.9.3 and enhance integration
- Update Sparkle dependency to 2.9.3 - Replace brittle HTML parsing with native NSAttributedString parsing - Fix dangling updater callbacks by handling view disappear events - Add 'Remind Me Later' button in update prompt - Add toggle for automatic background update checks
This commit is contained in:
@@ -14,7 +14,12 @@ final class SparkleUpdater: NSObject, ObservableObject, SPUUpdaterDelegate {
|
||||
|
||||
@Published var updateStatus: String?
|
||||
@Published var foundUpdateItem: SUAppcastItem?
|
||||
@Published var releaseNotes: String?
|
||||
@Published var releaseNotes: AttributedString?
|
||||
@Published var automaticallyChecksForUpdates: Bool = true {
|
||||
didSet {
|
||||
_updater?.automaticallyChecksForUpdates = automaticallyChecksForUpdates
|
||||
}
|
||||
}
|
||||
|
||||
var expectedContentLength: UInt64 = 0
|
||||
var receivedContentLength: UInt64 = 0
|
||||
@@ -28,6 +33,7 @@ final class SparkleUpdater: NSObject, ObservableObject, SPUUpdaterDelegate {
|
||||
self._updater = SPUUpdater(hostBundle: hostBundle, applicationBundle: hostBundle, userDriver: driver, delegate: self)
|
||||
do {
|
||||
try self._updater?.start()
|
||||
self.automaticallyChecksForUpdates = self._updater?.automaticallyChecksForUpdates ?? true
|
||||
} catch {
|
||||
print("Failed to start Sparkle updater: \(error)")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user