Revert "fix(frontend): don't UserDraft.remove flows while route is still mounted"

This reverts commit 079ebef72b.
This commit is contained in:
Diego Imbert
2026-05-12 14:58:27 +02:00
parent 079ebef72b
commit bee09613b5
2 changed files with 3 additions and 5 deletions
@@ -174,9 +174,11 @@
<FlowBuilder
onSaveInitial={(e) => {
UserDraft.remove('flow', '')
goto(`/flows/edit/${e.path}?selected=${e.id}`)
}}
onDeploy={(e) => {
UserDraft.remove('flow', '')
goto(`/flows/get/${e.path}?workspace=${$workspaceStore}`)
}}
onDetails={(e) => {
@@ -270,11 +270,7 @@
{:else}
<FlowBuilder
onDeploy={(e) => {
// Don't UserDraft.remove here — the route's flowStore reads the
// handle's draft directly, so clearing it before goto would blank
// the flow value and trip UnsavedConfirmationModal. The entry's
// ref count drops on unmount and the next visit's load-time diff
// will silently overwrite localStorage with the deployed value.
UserDraft.remove('flow', flowDraftPath)
goto(`/flows/get/${e.path}?workspace=${$workspaceStore}`)
}}
onDetails={(e) => {