Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(editor): Fix Nodeview.v2 reinitialise based on route changes #12062

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/editor-ui/src/views/NodeView.v2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ async function initializeData() {
}
}

async function initializeRoute() {
async function initializeRoute(force = false) {
// In case the workflow got saved we do not have to run init
// as only the route changed but all the needed data is already loaded
if (route.params.action === 'workflowSave') {
Expand All @@ -300,6 +300,7 @@ async function initializeRoute() {
}

const isAlreadyInitialized =
!force &&
initializedWorkflowId.value &&
[NEW_WORKFLOW_ID, workflowId.value].includes(initializedWorkflowId.value);

Expand Down Expand Up @@ -1489,8 +1490,10 @@ function unregisterCustomActions() {

watch(
() => route.name,
async () => {
await initializeRoute();
async (newRouteName, oldRouteName) => {
// it's navigating from and existing workflow to a new workflow
const force = newRouteName === VIEWS.NEW_WORKFLOW && oldRouteName === VIEWS.WORKFLOW;
await initializeRoute(force);
},
);

Expand Down
Loading