Skip to content

Commit

Permalink
use scope pointer to avoid copying store state
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectronicBlueberry committed Nov 6, 2023
1 parent f6a8290 commit 523d7ac
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions client/src/components/Workflow/Editor/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 523d7ac

Please sign in to comment.