From 456948ffd99735ba03a9ff9efa37c1bee10d9125 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Fri, 6 Jan 2023 19:14:17 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=20WIP:=20Broken=20services=20toggl?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit You can break it by opening the menu twice. --- PHP Monitor.xcodeproj/project.pbxproj | 2 +- phpmon/Domain/App/Services/ServicesManager.swift | 5 ----- phpmon/Domain/App/Services/ValetServicesManager.swift | 4 ++++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/PHP Monitor.xcodeproj/project.pbxproj b/PHP Monitor.xcodeproj/project.pbxproj index 32055c8..d0f44a2 100644 --- a/PHP Monitor.xcodeproj/project.pbxproj +++ b/PHP Monitor.xcodeproj/project.pbxproj @@ -1298,9 +1298,9 @@ C45B9147295607E200F4EC78 /* Services */ = { isa = PBXGroup; children = ( + C45B9148295607F400F4EC78 /* ServiceWrapper.swift */, C45E76132854A65300B4FE0C /* ServicesManager.swift */, C45B914D295608E300F4EC78 /* ValetServicesManager.swift */, - C45B9148295607F400F4EC78 /* ServiceWrapper.swift */, C45B91522956123A00F4EC78 /* FakeServicesManager.swift */, ); path = Services; diff --git a/phpmon/Domain/App/Services/ServicesManager.swift b/phpmon/Domain/App/Services/ServicesManager.swift index 0cd58ca..be7c746 100644 --- a/phpmon/Domain/App/Services/ServicesManager.swift +++ b/phpmon/Domain/App/Services/ServicesManager.swift @@ -93,11 +93,6 @@ class ServicesManager: ObservableObject { public func broadcastServicesUpdated() { Task { @MainActor in self.serviceWrappers.forEach { wrapper in - guard let service = wrapper.service else { - return - } - - Log.perf("\(service.name): \(wrapper.status)") wrapper.objectWillChange.send() } diff --git a/phpmon/Domain/App/Services/ValetServicesManager.swift b/phpmon/Domain/App/Services/ValetServicesManager.swift index ac02c25..baca249 100644 --- a/phpmon/Domain/App/Services/ValetServicesManager.swift +++ b/phpmon/Domain/App/Services/ValetServicesManager.swift @@ -59,6 +59,10 @@ class ValetServicesManager: ServicesManager { for service in services { self[service.name]?.service = service } + + for wrapper in serviceWrappers { + wrapper.isBusy = false + } } // Broadcast that all services have been updated