mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-11-07 05:10:06 +01:00
👌 Fixed onboarding for initial launch
This commit is contained in:
@@ -44,7 +44,7 @@ final class HomebrewService: Sendable, Decodable {
|
||||
/**
|
||||
Dummy data for preview purposes.
|
||||
*/
|
||||
public static func dummy(named service: String, enabled: Bool) -> HomebrewService {
|
||||
public static func dummy(named service: String, enabled: Bool, status: String? = nil) -> HomebrewService {
|
||||
return HomebrewService(
|
||||
name: service,
|
||||
service_name: service,
|
||||
@@ -52,7 +52,7 @@ final class HomebrewService: Sendable, Decodable {
|
||||
loaded: enabled,
|
||||
pid: nil,
|
||||
user: nil,
|
||||
status: nil,
|
||||
status: status,
|
||||
log_path: nil,
|
||||
error_log_path: nil
|
||||
)
|
||||
|
||||
@@ -41,9 +41,14 @@ class FakeServicesManager: ServicesManager {
|
||||
|
||||
private func reapplyServices() {
|
||||
let services = self.formulae.map {
|
||||
let dummy = HomebrewService.dummy(
|
||||
named: $0.name,
|
||||
enabled: self.fixedStatus == .active,
|
||||
status: self.fixedStatus == .error ? "error" : nil
|
||||
)
|
||||
let wrapper = Service(
|
||||
formula: $0,
|
||||
service: HomebrewService.dummy(named: $0.name, enabled: self.fixedStatus == .active)
|
||||
service: dummy
|
||||
)
|
||||
return wrapper
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ extension MainMenu {
|
||||
#endif
|
||||
|
||||
// Present first launch screen if needed
|
||||
if Stats.successfulLaunchCount == 0 && !isRunningSwiftUIPreview {
|
||||
if Stats.successfulLaunchCount == 1 && !isRunningSwiftUIPreview {
|
||||
Log.info("Should present the first launch screen!")
|
||||
Task { @MainActor in
|
||||
OnboardingWindowController.show()
|
||||
|
||||
Reference in New Issue
Block a user