From 89d8be89c2149bd9955c8baa6157515d25ff46a1 Mon Sep 17 00:00:00 2001 From: Jarek Krochmalski Date: Wed, 9 Sep 2026 09:37:27 +0530 Subject: [PATCH] clear the stale unsaved-changes flag when a stack redeploy fails --- src/routes/stacks/StackModal.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/routes/stacks/StackModal.svelte b/src/routes/stacks/StackModal.svelte index cf78049..ca1db67 100644 --- a/src/routes/stacks/StackModal.svelte +++ b/src/routes/stacks/StackModal.svelte @@ -1877,6 +1877,12 @@ throw new Error((typeof data.error === 'string' ? data.error : data.message) || 'Failed to save compose file'); } if (data.success === false) { + // On the restart path the server persists the compose+env BEFORE deploying, + // so a success:false here is a failed DEPLOY, not a failed save -- the content + // is already on disk. Clear the dirty flag so the footer doesn't claim + // "Unsaved changes" for edits that were in fact saved; the deploy error still + // surfaces via the throw below. (Plain save keeps isDirty on a real save fail.) + if (restart) isDirty = false; throw new Error(data.error || 'Failed to save compose file'); }