From 2a5b2c6b9c98cade25787182c646df69a96f3aba Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 24 Feb 2025 15:42:50 +0100 Subject: [PATCH] fix: fix confirmation modal check on deploy --- .../confirmationModal/UnsavedConfirmationModal.svelte | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/common/confirmationModal/UnsavedConfirmationModal.svelte b/frontend/src/lib/components/common/confirmationModal/UnsavedConfirmationModal.svelte index fbca9597cf..e0161044a4 100644 --- a/frontend/src/lib/components/common/confirmationModal/UnsavedConfirmationModal.svelte +++ b/frontend/src/lib/components/common/confirmationModal/UnsavedConfirmationModal.svelte @@ -32,11 +32,12 @@ // console.log('going to', newNavigationState.to.url) goingTo = newNavigationState.to.url + if (newNavigationState.type != 'popstate') { + await tick() // make sure saved value is updated when clicking on save draft or deploy + } + async function openModal() { newNavigationState.cancel() - if (newNavigationState.type != 'popstate') { - await tick() // make sure saved value is updated when clicking on save draft or deploy - } open = true } if (savedValue && modifiedValue) { @@ -45,6 +46,7 @@ path: undefined }) const current = cleanValueProperties({ ...(modifiedValue ?? {}), path: undefined }) + if ( orderedJsonStringify(replaceFalseWithUndefined(draftOrDeployed)) === orderedJsonStringify(replaceFalseWithUndefined(current))