mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 21:20:29 +00:00
Prevent multiple deploymentFinished event dispatches
Add flag to ensure event is only dispatched once, avoiding wasteful duplicate dispatches during the race condition window before Livewire removes wire:poll from the DOM. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,8 @@ class Show extends Component
|
||||
|
||||
public bool $is_debug_enabled = false;
|
||||
|
||||
private bool $deploymentFinishedDispatched = false;
|
||||
|
||||
public function getListeners()
|
||||
{
|
||||
return [
|
||||
@@ -92,8 +94,9 @@ class Show extends Component
|
||||
$this->horizon_job_status = $this->application_deployment_queue->getHorizonJobStatus();
|
||||
$this->isKeepAliveOn();
|
||||
|
||||
// Dispatch event when deployment finishes to stop auto-scroll
|
||||
if (! $this->isKeepAliveOn) {
|
||||
// Dispatch event when deployment finishes to stop auto-scroll (only once)
|
||||
if (! $this->isKeepAliveOn && ! $this->deploymentFinishedDispatched) {
|
||||
$this->deploymentFinishedDispatched = true;
|
||||
$this->dispatch('deploymentFinished');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user