1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 03:50:08 +02:00

🐛 Fix user initiated issue

This commit is contained in:
2023-03-03 15:28:00 +01:00
parent d1498eb070
commit 063a729d67
4 changed files with 6 additions and 6 deletions

View File

@ -14,10 +14,10 @@ class AppUpdater {
var latestVersionOnline: AppVersion! var latestVersionOnline: AppVersion!
var interactive: Bool = false var interactive: Bool = false
public func checkForUpdates(interactive: Bool) async { public func checkForUpdates(userInitiated: Bool) async {
self.interactive = interactive self.interactive = userInitiated
if interactive && !Preferences.isEnabled(.automaticBackgroundUpdateCheck) { if !interactive && !Preferences.isEnabled(.automaticBackgroundUpdateCheck) {
Log.info("Skipping automatic update check due to user preference.") Log.info("Skipping automatic update check due to user preference.")
return return
} }

View File

@ -114,7 +114,7 @@ extension MainMenu {
OnboardingWindowController.show() OnboardingWindowController.show()
} }
} else { } else {
await AppUpdater().checkForUpdates(interactive: false) await AppUpdater().checkForUpdates(userInitiated: false)
} }
} }

View File

@ -199,7 +199,7 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate, PhpSwitcherDelegate
} }
@objc func checkForUpdates() { @objc func checkForUpdates() {
Task { await AppUpdater().checkForUpdates(interactive: true) } Task { await AppUpdater().checkForUpdates(userInitiated: true) }
} }
// MARK: - Menu Delegate // MARK: - Menu Delegate

View File

@ -48,7 +48,7 @@ class OnboardingWindowController: PMWindowController {
// Search for updates after closing the window // Search for updates after closing the window
if Stats.successfulLaunchCount == 1 { if Stats.successfulLaunchCount == 1 {
Task { await AppUpdater().checkForUpdates(interactive: false) } Task { await AppUpdater().checkForUpdates(userInitiated: false) }
} }
} }
} }