macOS: Make a lot of things more robust

This commit is contained in:
Mitchell Hashimoto
2025-10-10 07:11:22 -07:00
parent ba8eae027e
commit 6993947a3a
6 changed files with 34 additions and 15 deletions

View File

@@ -32,9 +32,22 @@ class UpdateController {
/// Start the updater.
///
/// This must be called before the updater can check for updates. If starting fails,
/// an error alert will be shown after a short delay.
/// the error will be shown to the user.
func startUpdater() {
try? updater.start()
do {
try updater.start()
} catch {
userDriver.viewModel.state = .error(.init(
error: error,
retry: { [weak self] in
self?.userDriver.viewModel.state = .idle
self?.startUpdater()
},
dismiss: { [weak self] in
self?.userDriver.viewModel.state = .idle
}
))
}
}
/// Check for updates.