From a71bf07dbf1017d7e971f64528e499c53c49a0bb Mon Sep 17 00:00:00 2001 From: sneak Date: Thu, 1 Jan 2026 06:52:43 -0800 Subject: [PATCH] Fix deploy button strobing by using deployment status Use latestDeploymentStatus instead of app status to determine if a deployment is in progress. The deployment status is more reliable during state transitions and prevents the button from flickering. --- static/js/app.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index 1b981a9..c9721f3 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -327,7 +327,10 @@ document.addEventListener("alpine:init", () => { try { const res = await fetch(`/apps/${this.appId}/status`); const data = await res.json(); - const deploying = Alpine.store("utils").isDeploying(data.status); + // Use deployment status, not app status - it's more reliable during transitions + const deploying = Alpine.store("utils").isDeploying( + data.latestDeploymentStatus, + ); // Detect new deployment if ( @@ -347,13 +350,13 @@ document.addEventListener("alpine:init", () => { } this.currentDeploymentId = data.latestDeploymentID; - if (deploying) { - this.isDeploying = true; - } } - // Reload page when deployment finishes - if (!deploying && this.isDeploying) { + // Update deploying state based on latest deployment status + if (deploying && !this.isDeploying) { + this.isDeploying = true; + } else if (!deploying && this.isDeploying) { + // Deployment finished - reload to show final state this.isDeploying = false; window.location.reload(); }