From f995426fb32d810577dad5d46f275cc4a6e5c38d Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Tue, 23 Dec 2025 15:34:09 +0100 Subject: [PATCH] fix(sentinel): Add missing instantSave method and prevent duplicate notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add public instantSave() method to handle instant saves from checkbox clicks - Remove redundant updatedIsMetricsEnabled() and updatedIsSentinelDebugEnabled() hooks - These hooks were causing duplicate notifications when checkboxes were toggled The instantSave attribute on checkboxes triggers wire:click='instantSave', which was failing because the method didn't exist. Now it saves settings and restarts Sentinel in one action, preventing the duplicate updates from both wire:click and wire:model events. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 --- app/Livewire/Server/Sentinel.php | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/app/Livewire/Server/Sentinel.php b/app/Livewire/Server/Sentinel.php index 20135f3c9..cdcdc71fc 100644 --- a/app/Livewire/Server/Sentinel.php +++ b/app/Livewire/Server/Sentinel.php @@ -110,26 +110,6 @@ public function restartSentinel() } } - public function updatedIsSentinelDebugEnabled($value) - { - try { - $this->submit(); - $this->restartSentinel(); - } catch (\Throwable $e) { - return handleError($e, $this); - } - } - - public function updatedIsMetricsEnabled($value) - { - try { - $this->submit(); - $this->restartSentinel(); - } catch (\Throwable $e) { - return handleError($e, $this); - } - } - public function updatedIsSentinelEnabled($value) { try { @@ -175,6 +155,16 @@ public function submit() } } + public function instantSave() + { + try { + $this->syncData(true); + $this->restartSentinel(); + } catch (\Throwable $e) { + return handleError($e, $this); + } + } + public function render() { return view('livewire.server.sentinel');