fix: improve unsaved confirmation modal on flow draft

This commit is contained in:
Ruben Fiszel
2024-04-14 23:17:06 +02:00
parent 05390f9825
commit 30b962e2b8
3 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -40,10 +40,8 @@
"eslint": "^8.47.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-svelte": "^2.33.1",
"ol": "^7.4.0",
"openapi-typescript-codegen": "^0.25.0",
"path-browserify": "^1.0.1",
"pdfjs-dist": "^3.8.162",
"postcss": "^8.4.24",
"postcss-load-config": "^4.0.1",
"prettier": "^2.8.8",
@@ -116,6 +114,8 @@
"highlight.js": "^11.8.0",
"lodash": "^4.17.21",
"lucide-svelte": "^0.293.0",
"ol": "^7.4.0",
"pdfjs-dist": "^3.8.162",
"monaco-editor": "npm:@codingame/monaco-editor-treemended@>=1.83.5 <1.84.0",
"monaco-graphql": "^1.5.1",
"monaco-languageclient": "~7.0.1",
@@ -24,8 +24,11 @@
newNavigationState.cancel()
await tick() // make sure saved value is updated when clicking on save draft or deploy
if (savedValue && modifiedValue) {
const draftOrDeployed = cleanValueProperties(savedValue.draft || savedValue)
const current = cleanValueProperties(modifiedValue)
const draftOrDeployed = cleanValueProperties({
...((savedValue.draft || savedValue) ?? {}),
path: undefined
})
const current = cleanValueProperties({ ...(modifiedValue ?? {}), path: undefined })
if (orderedJsonStringify(draftOrDeployed) === orderedJsonStringify(current)) {
bypassBeforeNavigate = true
goto(goingTo)
@@ -153,8 +153,5 @@
{selectedId}
{loading}
>
<UnsavedConfirmationModal
savedValue={{ ...savedFlow, path: undefined }}
modifiedValue={$flowStore}
/></FlowBuilder
<UnsavedConfirmationModal savedValue={savedFlow} modifiedValue={$flowStore} /></FlowBuilder
>