From bd88bbca5ba4b7707f0370e2fd98ce7517809c5d Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Fri, 10 Oct 2025 10:41:58 +0200 Subject: [PATCH] fix: streamline proxy status handling in StartProxy and Navbar components --- app/Actions/Proxy/StartProxy.php | 9 ++++++--- app/Livewire/Server/Navbar.php | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Actions/Proxy/StartProxy.php b/app/Actions/Proxy/StartProxy.php index ecfb13d0b..8671a5f27 100644 --- a/app/Actions/Proxy/StartProxy.php +++ b/app/Actions/Proxy/StartProxy.php @@ -19,6 +19,11 @@ public function handle(Server $server, bool $async = true, bool $force = false): if ((is_null($proxyType) || $proxyType === 'NONE' || $server->proxy->force_stop || $server->isBuildServer()) && $force === false) { return 'OK'; } + $server->proxy->set('status', 'starting'); + $server->save(); + $server->refresh(); + ProxyStatusChangedUI::dispatch($server->team_id); + $commands = collect([]); $proxy_path = $server->proxyPath(); $configuration = GetProxyConfiguration::run($server); @@ -64,14 +69,12 @@ public function handle(Server $server, bool $async = true, bool $force = false): ]); $commands = $commands->merge(connectProxyToNetworks($server)); } - $server->proxy->set('status', 'starting'); - $server->save(); - ProxyStatusChangedUI::dispatch($server->team_id); if ($async) { return remote_process($commands, $server, callEventOnFinish: 'ProxyStatusChanged', callEventData: $server->id); } else { instant_remote_process($commands, $server); + $server->proxy->set('type', $proxyType); $server->save(); ProxyStatusChanged::dispatch($server->id); diff --git a/app/Livewire/Server/Navbar.php b/app/Livewire/Server/Navbar.php index 32799b83d..6baa54672 100644 --- a/app/Livewire/Server/Navbar.php +++ b/app/Livewire/Server/Navbar.php @@ -120,7 +120,6 @@ public function showNotification() { $this->server->refresh(); $this->proxyStatus = $this->server->proxy->status ?? 'unknown'; - $forceStop = $this->server->proxy->force_stop ?? false; switch ($this->proxyStatus) { case 'running':