Skip to content

Commit

Permalink
🐛 Don't load services info when standalone (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoverbruggen committed May 30, 2023
1 parent 2a74b11 commit 02f579f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
24 changes: 12 additions & 12 deletions PHP Monitor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3362,7 +3362,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1250;
CURRENT_PROJECT_VERSION = 1252;
DEAD_CODE_STRIPPING = YES;
DEBUG = YES;
DEVELOPMENT_TEAM = 8M54J5J787;
Expand All @@ -3375,7 +3375,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.4;
MARKETING_VERSION = 6.0;
MARKETING_VERSION = 6.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -3392,7 +3392,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1250;
CURRENT_PROJECT_VERSION = 1252;
DEAD_CODE_STRIPPING = YES;
DEBUG = NO;
DEVELOPMENT_TEAM = 8M54J5J787;
Expand All @@ -3405,7 +3405,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.4;
MARKETING_VERSION = 6.0;
MARKETING_VERSION = 6.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3630,7 +3630,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1250;
CURRENT_PROJECT_VERSION = 1252;
DEAD_CODE_STRIPPING = YES;
DEBUG = NO;
DEVELOPMENT_TEAM = 8M54J5J787;
Expand All @@ -3643,7 +3643,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.4;
MARKETING_VERSION = 6.0;
MARKETING_VERSION = 6.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon.dev;
PRODUCT_NAME = "$(TARGET_NAME) DEV";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3744,7 +3744,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1250;
CURRENT_PROJECT_VERSION = 1252;
DEAD_CODE_STRIPPING = YES;
DEBUG = YES;
DEVELOPMENT_TEAM = 8M54J5J787;
Expand All @@ -3757,7 +3757,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.4;
MARKETING_VERSION = 6.0;
MARKETING_VERSION = 6.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon.dev;
PRODUCT_NAME = "$(TARGET_NAME) DEV";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3858,7 +3858,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1250;
CURRENT_PROJECT_VERSION = 1252;
DEAD_CODE_STRIPPING = YES;
DEBUG = YES;
DEVELOPMENT_TEAM = 8M54J5J787;
Expand All @@ -3871,7 +3871,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.4;
MARKETING_VERSION = 6.0;
MARKETING_VERSION = 6.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon.eap;
PRODUCT_NAME = "$(TARGET_NAME) EAP";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -4037,7 +4037,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1250;
CURRENT_PROJECT_VERSION = 1252;
DEAD_CODE_STRIPPING = YES;
DEBUG = NO;
DEVELOPMENT_TEAM = 8M54J5J787;
Expand All @@ -4050,7 +4050,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.4;
MARKETING_VERSION = 6.0;
MARKETING_VERSION = 6.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon.eap;
PRODUCT_NAME = "$(TARGET_NAME) EAP";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
4 changes: 4 additions & 0 deletions phpmon/Domain/App/Services/ValetServicesManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class ValetServicesManager: ServicesManager {
these two commands are executed concurrently.
*/
override func reloadServicesStatus() async {
if !Valet.installed {
return Log.info("Not reloading services because running in Standalone Mode.")
}

await withTaskGroup(of: [HomebrewService].self, body: { group in
// First, retrieve the status of the formulae that run as root
group.addTask {
Expand Down
8 changes: 7 additions & 1 deletion phpmon/Domain/Menu/MainMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,13 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate, PhpSwitcherDelegate
func menuWillOpen(_ menu: NSMenu) {
// Make sure the shortcut key does not trigger this when the menu is open
App.shared.shortcutHotkey?.isPaused = true
Task { // Reload Homebrew services information asynchronously

// Exit early if Valet is not detected (i.e. standalone mode)
if !Valet.installed {
return
}

Task { // Reload Homebrew services information asynchronously, but only if Valet is enabled
await ServicesManager.shared.reloadServicesStatus()
}
}
Expand Down

0 comments on commit 02f579f

Please sign in to comment.