Skip to content

Commit 4b6db26

Browse files
r00gmivov
authored andcommitted
fix(editor): Fix Nodeview.v2 reinitialise based on route changes (#12062)
1 parent 728dba2 commit 4b6db26

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/editor-ui/src/views/NodeView.v2.vue

+6-3
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ async function initializeData() {
291291
}
292292
}
293293
294-
async function initializeRoute() {
294+
async function initializeRoute(force = false) {
295295
// In case the workflow got saved we do not have to run init
296296
// as only the route changed but all the needed data is already loaded
297297
if (route.params.action === 'workflowSave') {
@@ -300,6 +300,7 @@ async function initializeRoute() {
300300
}
301301
302302
const isAlreadyInitialized =
303+
!force &&
303304
initializedWorkflowId.value &&
304305
[NEW_WORKFLOW_ID, workflowId.value].includes(initializedWorkflowId.value);
305306
@@ -1489,8 +1490,10 @@ function unregisterCustomActions() {
14891490
14901491
watch(
14911492
() => route.name,
1492-
async () => {
1493-
await initializeRoute();
1493+
async (newRouteName, oldRouteName) => {
1494+
// it's navigating from and existing workflow to a new workflow
1495+
const force = newRouteName === VIEWS.NEW_WORKFLOW && oldRouteName === VIEWS.WORKFLOW;
1496+
await initializeRoute(force);
14941497
},
14951498
);
14961499

0 commit comments

Comments
 (0)