Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Prevent multiple deploymentFinished event dispatches

Andras Bacsai56102f632140
diff --git a/app/Livewire/Project/Application/Deployment/Show.php b/app/Livewire/Project/Application/Deployment/Show.php
index 6d50fb3c7c..44ab419c24 100644
--- a/app/Livewire/Project/Application/Deployment/Show.php
+++ b/app/Livewire/Project/Application/Deployment/Show.php
@@ -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');
}
}