Fix ignore confirmation modal if no changes (#4725)

This commit is contained in:
pyranota
2024-11-15 18:47:09 +00:00
committed by GitHub
parent 56f70fd7de
commit 9065716020
@@ -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 {