mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-11-08 05:30:05 +01:00
♻️ Clarify parameter name
This commit is contained in:
@@ -19,9 +19,8 @@ class AppUpdateChecker {
|
|||||||
return App.version.contains("-dev")
|
return App.version.contains("-dev")
|
||||||
}()
|
}()
|
||||||
|
|
||||||
public static func checkIfNewerVersionIsAvailable(automaticallyInitiated: Bool = true) {
|
public static func checkIfNewerVersionIsAvailable(initiatedFromBackground: Bool = true) {
|
||||||
// Information about the status of a potential background update
|
if initiatedFromBackground {
|
||||||
if automaticallyInitiated {
|
|
||||||
if !Preferences.isEnabled(.automaticBackgroundUpdateCheck) {
|
if !Preferences.isEnabled(.automaticBackgroundUpdateCheck) {
|
||||||
Log.info("Automatic updates are disabled. No check will be performed.")
|
Log.info("Automatic updates are disabled. No check will be performed.")
|
||||||
return
|
return
|
||||||
@@ -38,7 +37,7 @@ class AppUpdateChecker {
|
|||||||
// We'll find out what the new version is by using `curl`
|
// We'll find out what the new version is by using `curl`
|
||||||
var command = "curl -s"
|
var command = "curl -s"
|
||||||
|
|
||||||
if automaticallyInitiated {
|
if initiatedFromBackground {
|
||||||
// If running as a background check, should only waste at most 3 secs of time
|
// If running as a background check, should only waste at most 3 secs of time
|
||||||
command = "curl -s --max-time 3"
|
command = "curl -s --max-time 3"
|
||||||
}
|
}
|
||||||
@@ -51,7 +50,7 @@ class AppUpdateChecker {
|
|||||||
Log.err("We couldn't check for updates!")
|
Log.err("We couldn't check for updates!")
|
||||||
|
|
||||||
// Only notify about connection issues if the request to check for updates was explicit
|
// Only notify about connection issues if the request to check for updates was explicit
|
||||||
if !automaticallyInitiated {
|
if !initiatedFromBackground {
|
||||||
notifyAboutConnectionIssue()
|
notifyAboutConnectionIssue()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,7 +62,7 @@ class AppUpdateChecker {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
handleVersionComparison(currentVersion, onlineVersion, automaticallyInitiated)
|
handleVersionComparison(currentVersion, onlineVersion, initiatedFromBackground)
|
||||||
}
|
}
|
||||||
|
|
||||||
private static func handleVersionComparison(
|
private static func handleVersionComparison(
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate, PhpSwitcherDelegate
|
|||||||
|
|
||||||
@objc func checkForUpdates() {
|
@objc func checkForUpdates() {
|
||||||
DispatchQueue.global(qos: .userInitiated).async {
|
DispatchQueue.global(qos: .userInitiated).async {
|
||||||
AppUpdateChecker.checkIfNewerVersionIsAvailable(automaticallyInitiated: false)
|
AppUpdateChecker.checkIfNewerVersionIsAvailable(initiatedFromBackground: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user