From a7f05ba61211dc2247bfb4ef7f28c468b3c657da Mon Sep 17 00:00:00 2001 From: HugoCasa Date: Wed, 13 Mar 2024 00:27:05 +0100 Subject: [PATCH] fix: initial path when changing path of draft only scripts and flows (#3400) Co-authored-by: Ruben Fiszel --- frontend/src/lib/components/FlowBuilder.svelte | 1 + frontend/src/lib/components/ScriptBuilder.svelte | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/FlowBuilder.svelte b/frontend/src/lib/components/FlowBuilder.svelte index d3376054a7..9a27d2ba01 100644 --- a/frontend/src/lib/components/FlowBuilder.svelte +++ b/frontend/src/lib/components/FlowBuilder.svelte @@ -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') diff --git a/frontend/src/lib/components/ScriptBuilder.svelte b/frontend/src/lib/components/ScriptBuilder.svelte index 0fed12b79b..0e8f4bda83 100644 --- a/frontend/src/lib/components/ScriptBuilder.svelte +++ b/frontend/src/lib/components/ScriptBuilder.svelte @@ -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')