mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(editor): Load appropriate credentials in canvas V2 for new workflow (#12722)
This commit is contained in:
@@ -349,6 +349,8 @@ async function initializeRoute(force = false) {
|
|||||||
if (!isAlreadyInitialized) {
|
if (!isAlreadyInitialized) {
|
||||||
historyStore.reset();
|
historyStore.reset();
|
||||||
|
|
||||||
|
await loadCredentials();
|
||||||
|
|
||||||
// If there is no workflow id, treat it as a new workflow
|
// If there is no workflow id, treat it as a new workflow
|
||||||
if (isNewWorkflowRoute.value || !workflowId.value) {
|
if (isNewWorkflowRoute.value || !workflowId.value) {
|
||||||
if (route.meta?.nodeView === true) {
|
if (route.meta?.nodeView === true) {
|
||||||
@@ -359,8 +361,6 @@ async function initializeRoute(force = false) {
|
|||||||
|
|
||||||
await initializeWorkspaceForExistingWorkflow(workflowId.value);
|
await initializeWorkspaceForExistingWorkflow(workflowId.value);
|
||||||
|
|
||||||
await loadCredentials();
|
|
||||||
|
|
||||||
void nextTick(() => {
|
void nextTick(() => {
|
||||||
nodeHelpers.updateNodesInputIssues();
|
nodeHelpers.updateNodesInputIssues();
|
||||||
nodeHelpers.updateNodesCredentialsIssues();
|
nodeHelpers.updateNodesCredentialsIssues();
|
||||||
@@ -820,8 +820,8 @@ function onClickNodeAdd(source: string, sourceHandle: string) {
|
|||||||
async function loadCredentials() {
|
async function loadCredentials() {
|
||||||
let options: { workflowId: string } | { projectId: string };
|
let options: { workflowId: string } | { projectId: string };
|
||||||
|
|
||||||
if (editableWorkflow.value) {
|
if (workflowId.value) {
|
||||||
options = { workflowId: editableWorkflow.value.id };
|
options = { workflowId: workflowId.value };
|
||||||
} else {
|
} else {
|
||||||
const queryParam =
|
const queryParam =
|
||||||
typeof route.query?.projectId === 'string' ? route.query?.projectId : undefined;
|
typeof route.query?.projectId === 'string' ? route.query?.projectId : undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user