mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
fix(editor): Set correct connection type when auto-adding nodes in new canvas (no-changelog) (#10966)
This commit is contained in:
parent
62159bd71c
commit
9bd247f06b
|
@ -859,6 +859,7 @@ async function onAddNodesAndConnections(
|
||||||
const mappedConnections: CanvasConnectionCreateData[] = connections.map(({ from, to }) => {
|
const mappedConnections: CanvasConnectionCreateData[] = connections.map(({ from, to }) => {
|
||||||
const fromNode = editableWorkflow.value.nodes[offsetIndex + from.nodeIndex];
|
const fromNode = editableWorkflow.value.nodes[offsetIndex + from.nodeIndex];
|
||||||
const toNode = editableWorkflow.value.nodes[offsetIndex + to.nodeIndex];
|
const toNode = editableWorkflow.value.nodes[offsetIndex + to.nodeIndex];
|
||||||
|
const type = from.type ?? to.type ?? NodeConnectionType.Main;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
source: fromNode.id,
|
source: fromNode.id,
|
||||||
|
@ -866,11 +867,11 @@ async function onAddNodesAndConnections(
|
||||||
data: {
|
data: {
|
||||||
source: {
|
source: {
|
||||||
index: from.outputIndex ?? 0,
|
index: from.outputIndex ?? 0,
|
||||||
type: NodeConnectionType.Main,
|
type,
|
||||||
},
|
},
|
||||||
target: {
|
target: {
|
||||||
index: to.inputIndex ?? 0,
|
index: to.inputIndex ?? 0,
|
||||||
type: NodeConnectionType.Main,
|
type,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue