From 69c124032c9d7604ea48c9a7570841fd0446a039 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 8 Dec 2023 12:23:12 +0100 Subject: [PATCH] fix --- app/Livewire/Project/Service/Index.php | 1 + app/Livewire/Project/Service/Navbar.php | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/Livewire/Project/Service/Index.php b/app/Livewire/Project/Service/Index.php index 4f3f9ce11..b40a115d5 100644 --- a/app/Livewire/Project/Service/Index.php +++ b/app/Livewire/Project/Service/Index.php @@ -38,6 +38,7 @@ class Index extends Component { dispatch_sync(new ContainerStatusJob($this->service->server)); $this->refreshStacks(); + $this->dispatch('updateStatus'); } public function refreshStacks() { diff --git a/app/Livewire/Project/Service/Navbar.php b/app/Livewire/Project/Service/Navbar.php index 0fe5e6bd9..537ae9e62 100644 --- a/app/Livewire/Project/Service/Navbar.php +++ b/app/Livewire/Project/Service/Navbar.php @@ -16,7 +16,8 @@ class Navbar extends Component public array $query; public $isDeploymentProgress = false; - public function checkDeployments() { + public function checkDeployments() + { $activity = Activity::where('properties->type_uuid', $this->service->uuid)->latest()->first(); $status = data_get($activity, 'properties.status'); if ($status === 'queued' || $status === 'in_progress') { @@ -27,15 +28,10 @@ class Navbar extends Component } public function getListeners() { - $userId = auth()->user()->id; return [ - "echo-private:custom.{$userId},ServiceStatusChanged" => 'serviceStatusChanged', + "updateStatus" => 'checkStatus', ]; } - public function serviceStatusChanged() - { - $this->service->refresh(); - } public function render() { return view('livewire.project.service.navbar');