Skip to content

Commit

Permalink
making sure the app does not launch before prompting the update
Browse files Browse the repository at this point in the history
  • Loading branch information
nodeful committed Nov 22, 2021
1 parent 4c6ef40 commit 87a6d76
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion native/app/Source/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, SUUpdaterDelegate {
}

if (Application.store.state.settings.doAutoCheckUpdates) {
var stillCheckingConnection = true
Networking.checkConnected { connected in
stillCheckingConnection = false
if (connected) {
Application.updater.checkForUpdatesInBackground()
} else {
Expand All @@ -41,7 +43,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, SUUpdaterDelegate {
}

delay(2000) {
self.updateProcessed.emit()
if (stillCheckingConnection) {
self.updateProcessed.emit()
}
}
} else {
self.updateProcessed.emit()
Expand Down

0 comments on commit 87a6d76

Please sign in to comment.