From 523d7acffde3eb5195e0c64806b5d13331774794 Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:19:38 +0100 Subject: [PATCH] use scope pointer to avoid copying store state --- client/src/components/Workflow/Editor/Index.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/components/Workflow/Editor/Index.vue b/client/src/components/Workflow/Editor/Index.vue index f805712ea473..937686c544b0 100644 --- a/client/src/components/Workflow/Editor/Index.vue +++ b/client/src/components/Workflow/Editor/Index.vue @@ -175,6 +175,7 @@ import { useUid } from "@/composables/utils/uid"; import { provideScopedWorkflowStores } from "@/composables/workflowStores"; import { hide_modal } from "@/layout/modal"; import { getAppRoot } from "@/onload/loadConfig"; +import { useScopePointerStore } from "@/stores/scopePointerStore"; import { LastQueue } from "@/utils/promise-queue"; import { defaultPosition } from "./composables/useDefaultStepPosition"; @@ -534,10 +535,13 @@ export default { .then((response) => { this.onWorkflowMessage("Workflow saved as", "success"); this.hideModal(); + this.onNavigate(`${getAppRoot()}workflows/edit?id=${response.data}`); + if (create) { - window.location = `${getAppRoot()}workflows/edit?id=${response.data}`; - } else { - this.onNavigate(`${getAppRoot()}workflows/edit?id=${response.data}`); + const { addScopePointer } = useScopePointerStore(); + // map scoped stores to existing stores, before updating the id + addScopePointer(response.data, this.id); + this.id = response.data; } }) .catch((response) => {