Fix a problem with duplicate edge created (#1269)

This commit is contained in:
Shuchang Zheng
2024-11-26 09:03:53 -08:00
committed by GitHub
parent 80f2d5ae96
commit 61f94af7f3

View File

@@ -543,10 +543,6 @@ function getElements(blocks: Array<WorkflowBlock>): {
nodes.push(nodeAdderNode(adderNodeId));
edges.push(defaultEdge(startNodeId, adderNodeId));
} else {
const firstNode = data.find(
(d) => d.previous === null && d.parentId === null,
);
edges.push(edgeWithAddButton(startNodeId, firstNode!.id));
const lastNode = data.find((d) => d.next === null && d.parentId === null)!;
edges.push(defaultEdge(lastNode.id, adderNodeId));
nodes.push(nodeAdderNode(adderNodeId));