fix: initial path when changing path of draft only scripts and flows (#3400)

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
This commit is contained in:
HugoCasa
2024-03-13 00:27:05 +01:00
committed by GitHub
parent ac08a8dd5d
commit a7f05ba612
2 changed files with 2 additions and 1 deletions

View File

@@ -192,6 +192,7 @@
if (newFlow) {
dispatch('saveInitial', $pathStore)
} else if (savedFlow?.draft_only && $pathStore !== initialPath) {
initialPath = $pathStore
goto(`/flows/edit/${$pathStore}?selected=${getSelectedId()}`)
}
sendUserToast('Saved as draft')

View File

@@ -368,7 +368,6 @@
: script.concurrency_key
}
})
initialPath = script.path
}
await DraftService.createDraft({
workspace: $workspaceStore!,
@@ -387,6 +386,7 @@
} as NewScriptWithDraft
if (initialPath == '' || (savedScript?.draft_only && script.path !== initialPath)) {
initialPath = script.path
goto(`/scripts/edit/${script.path}`)
}
sendUserToast('Saved as draft')