mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
fix(editor): Load appropriate credentials in canvas V2 for new workflow (#12722)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
This commit is contained in:
parent
1f43181360
commit
2020dc502f
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue