From dc2929e1f7075f90b8d38de392faacbd4b8bb7e1 Mon Sep 17 00:00:00 2001 From: ShadowArcanist Date: Mon, 29 Sep 2025 10:37:27 +0530 Subject: [PATCH] Added info toast to let the user know to restart the app after enabling healthcheck It only let the user know to restart if healthcheck is enabling while the app is in running state --- app/Livewire/Project/Shared/HealthChecks.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Livewire/Project/Shared/HealthChecks.php b/app/Livewire/Project/Shared/HealthChecks.php index 44f5c5e44..ee11c496d 100644 --- a/app/Livewire/Project/Shared/HealthChecks.php +++ b/app/Livewire/Project/Shared/HealthChecks.php @@ -51,9 +51,15 @@ public function toggleHealthcheck() { try { $this->authorize('update', $this->resource); + $wasEnabled = $this->resource->health_check_enabled; $this->resource->health_check_enabled = !$this->resource->health_check_enabled; $this->resource->save(); - $this->dispatch('success', 'Health check ' . ($this->resource->health_check_enabled ? 'enabled' : 'disabled') . '.'); + + if ($this->resource->health_check_enabled && !$wasEnabled && $this->resource->isRunning()) { + $this->dispatch('info', 'Health check has been enabled. A restart is required to apply the new settings.'); + } else { + $this->dispatch('success', 'Health check ' . ($this->resource->health_check_enabled ? 'enabled' : 'disabled') . '.'); + } } catch (\Throwable $e) { return handleError($e, $this); }