diff --git a/phpmon/Domain/App/AppUpdateChecker.swift b/phpmon/Domain/App/AppUpdateChecker.swift index 9b9375d..34c02b7 100644 --- a/phpmon/Domain/App/AppUpdateChecker.swift +++ b/phpmon/Domain/App/AppUpdateChecker.swift @@ -19,9 +19,8 @@ class AppUpdateChecker { return App.version.contains("-dev") }() - public static func checkIfNewerVersionIsAvailable(automaticallyInitiated: Bool = true) { - // Information about the status of a potential background update - if automaticallyInitiated { + public static func checkIfNewerVersionIsAvailable(initiatedFromBackground: Bool = true) { + if initiatedFromBackground { if !Preferences.isEnabled(.automaticBackgroundUpdateCheck) { Log.info("Automatic updates are disabled. No check will be performed.") return @@ -38,7 +37,7 @@ class AppUpdateChecker { // We'll find out what the new version is by using `curl` var command = "curl -s" - if automaticallyInitiated { + if initiatedFromBackground { // If running as a background check, should only waste at most 3 secs of time command = "curl -s --max-time 3" } @@ -51,7 +50,7 @@ class AppUpdateChecker { Log.err("We couldn't check for updates!") // Only notify about connection issues if the request to check for updates was explicit - if !automaticallyInitiated { + if !initiatedFromBackground { notifyAboutConnectionIssue() } @@ -63,7 +62,7 @@ class AppUpdateChecker { return } - handleVersionComparison(currentVersion, onlineVersion, automaticallyInitiated) + handleVersionComparison(currentVersion, onlineVersion, initiatedFromBackground) } private static func handleVersionComparison( diff --git a/phpmon/Domain/Menu/MainMenu.swift b/phpmon/Domain/Menu/MainMenu.swift index a45c929..69fb17b 100644 --- a/phpmon/Domain/Menu/MainMenu.swift +++ b/phpmon/Domain/Menu/MainMenu.swift @@ -339,7 +339,7 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate, PhpSwitcherDelegate @objc func checkForUpdates() { DispatchQueue.global(qos: .userInitiated).async { - AppUpdateChecker.checkIfNewerVersionIsAvailable(automaticallyInitiated: false) + AppUpdateChecker.checkIfNewerVersionIsAvailable(initiatedFromBackground: false) } }