mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
fix(editor): Fix Nodeview.v2 reinitialise based on route changes (#12062)
This commit is contained in:
parent
728dba26c9
commit
4b6db264c5
|
@ -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
|
// 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
|
// as only the route changed but all the needed data is already loaded
|
||||||
if (route.params.action === 'workflowSave') {
|
if (route.params.action === 'workflowSave') {
|
||||||
|
@ -300,6 +300,7 @@ async function initializeRoute() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const isAlreadyInitialized =
|
const isAlreadyInitialized =
|
||||||
|
!force &&
|
||||||
initializedWorkflowId.value &&
|
initializedWorkflowId.value &&
|
||||||
[NEW_WORKFLOW_ID, workflowId.value].includes(initializedWorkflowId.value);
|
[NEW_WORKFLOW_ID, workflowId.value].includes(initializedWorkflowId.value);
|
||||||
|
|
||||||
|
@ -1489,8 +1490,10 @@ function unregisterCustomActions() {
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => route.name,
|
() => route.name,
|
||||||
async () => {
|
async (newRouteName, oldRouteName) => {
|
||||||
await initializeRoute();
|
// it's navigating from and existing workflow to a new workflow
|
||||||
|
const force = newRouteName === VIEWS.NEW_WORKFLOW && oldRouteName === VIEWS.WORKFLOW;
|
||||||
|
await initializeRoute(force);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue