From 9065716020ab25b0b6697ff15021b53fb97f7f5d Mon Sep 17 00:00:00 2001 From: pyranota <92104930+pyranota@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:47:09 +0000 Subject: [PATCH] Fix ignore confirmation modal if no changes (#4725) --- .../UnsavedConfirmationModal.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/common/confirmationModal/UnsavedConfirmationModal.svelte b/frontend/src/lib/components/common/confirmationModal/UnsavedConfirmationModal.svelte index 364af3996e..e8a314e0d0 100644 --- a/frontend/src/lib/components/common/confirmationModal/UnsavedConfirmationModal.svelte +++ b/frontend/src/lib/components/common/confirmationModal/UnsavedConfirmationModal.svelte @@ -4,7 +4,12 @@ import { goto as gotoUrl } from '$app/navigation' import Button from '../button/Button.svelte' import type DiffDrawer from '$lib/components/DiffDrawer.svelte' - import { cleanValueProperties, orderedJsonStringify, type Value } from '$lib/utils' + import { + cleanValueProperties, + orderedJsonStringify, + replaceFalseWithUndefined, + type Value + } from '$lib/utils' import { tick } from 'svelte' import { page } from '$app/stores' @@ -36,7 +41,10 @@ path: undefined }) const current = cleanValueProperties({ ...(modifiedValue ?? {}), path: undefined }) - if (orderedJsonStringify(draftOrDeployed) === orderedJsonStringify(current)) { + if ( + orderedJsonStringify(replaceFalseWithUndefined(draftOrDeployed)) === + orderedJsonStringify(replaceFalseWithUndefined(current)) + ) { bypassBeforeNavigate = true gotoUrl(goingTo) } else {