fix(editor): Set correct connection type when auto-adding nodes in new canvas (no-changelog) (#10966)

This commit is contained in:
Alex Grozav 2024-09-25 15:00:06 +03:00 committed by GitHub
parent 62159bd71c
commit 9bd247f06b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -859,6 +859,7 @@ async function onAddNodesAndConnections(
const mappedConnections: CanvasConnectionCreateData[] = connections.map(({ from, to }) => {
const fromNode = editableWorkflow.value.nodes[offsetIndex + from.nodeIndex];
const toNode = editableWorkflow.value.nodes[offsetIndex + to.nodeIndex];
const type = from.type ?? to.type ?? NodeConnectionType.Main;
return {
source: fromNode.id,
@ -866,11 +867,11 @@ async function onAddNodesAndConnections(
data: {
source: {
index: from.outputIndex ?? 0,
type: NodeConnectionType.Main,
type,
},
target: {
index: to.inputIndex ?? 0,
type: NodeConnectionType.Main,
type,
},
},
};