From 2020dc502feae6cae827dfbcc40ffed89bcc334a Mon Sep 17 00:00:00 2001 From: Csaba Tuncsik Date: Thu, 23 Jan 2025 11:01:10 +0100 Subject: [PATCH] fix(editor): Load appropriate credentials in canvas V2 for new workflow (#12722) --- packages/editor-ui/src/views/NodeView.v2.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/editor-ui/src/views/NodeView.v2.vue b/packages/editor-ui/src/views/NodeView.v2.vue index b09ca822a0..eee1bf0357 100644 --- a/packages/editor-ui/src/views/NodeView.v2.vue +++ b/packages/editor-ui/src/views/NodeView.v2.vue @@ -349,6 +349,8 @@ async function initializeRoute(force = false) { if (!isAlreadyInitialized) { historyStore.reset(); + await loadCredentials(); + // If there is no workflow id, treat it as a new workflow if (isNewWorkflowRoute.value || !workflowId.value) { if (route.meta?.nodeView === true) { @@ -359,8 +361,6 @@ async function initializeRoute(force = false) { await initializeWorkspaceForExistingWorkflow(workflowId.value); - await loadCredentials(); - void nextTick(() => { nodeHelpers.updateNodesInputIssues(); nodeHelpers.updateNodesCredentialsIssues(); @@ -820,8 +820,8 @@ function onClickNodeAdd(source: string, sourceHandle: string) { async function loadCredentials() { let options: { workflowId: string } | { projectId: string }; - if (editableWorkflow.value) { - options = { workflowId: editableWorkflow.value.id }; + if (workflowId.value) { + options = { workflowId: workflowId.value }; } else { const queryParam = typeof route.query?.projectId === 'string' ? route.query?.projectId : undefined;