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(); }