From 9c8da2aa1c42ba2f5fa38989049b6c99a40e7e7f Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Wed, 22 Mar 2023 21:49:55 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Mark=20as=20busy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpmon/Domain/SwiftUI/PhpManager/PhpFormulaeView.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpmon/Domain/SwiftUI/PhpManager/PhpFormulaeView.swift b/phpmon/Domain/SwiftUI/PhpManager/PhpFormulaeView.swift index 18b6097..cf2fa61 100644 --- a/phpmon/Domain/SwiftUI/PhpManager/PhpFormulaeView.swift +++ b/phpmon/Domain/SwiftUI/PhpManager/PhpFormulaeView.swift @@ -150,6 +150,7 @@ struct PhpFormulaeView: View { let command = InstallPhpVersionCommand(formula: formula.name) do { + PhpEnv.shared.isBusy = true try await command.execute { progress in Task { @MainActor in self.status.title = progress.title @@ -157,11 +158,13 @@ struct PhpFormulaeView: View { self.status.busy = progress.value != 1 if progress.value == 1 { + PhpEnv.shared.isBusy = false await self.handler.refreshPhpVersions(loadOutdated: false) } } } } catch { + PhpEnv.shared.isBusy = false Task { @MainActor in self.status.busy = false } @@ -179,6 +182,7 @@ struct PhpFormulaeView: View { let command = RemovePhpVersionCommand(formula: formula.name) do { + PhpEnv.shared.isBusy = true try await command.execute { progress in Task { @MainActor in self.status.title = progress.title @@ -187,10 +191,12 @@ struct PhpFormulaeView: View { if progress.value == 1 { await self.handler.refreshPhpVersions(loadOutdated: false) + PhpEnv.shared.isBusy = false } } } } catch { + PhpEnv.shared.isBusy = false Task { @MainActor in self.status.busy = false }