fix: could not add branches in workflows

This commit is contained in:
Fu Diwei 2025-06-03 22:37:03 +08:00
parent e6cf4d3e07
commit f94db675fb

View File

@ -483,10 +483,6 @@ export const cloneNode = (sourceNode: WorkflowNode): WorkflowNode => {
}; };
export const addNode = (root: WorkflowNode, targetNode: WorkflowNode, previousNodeId: string) => { export const addNode = (root: WorkflowNode, targetNode: WorkflowNode, previousNodeId: string) => {
if (isBranchNode(targetNode)) {
throw new Error("Cannot add a branch node directly. Use `addBranch` instead.");
}
return produce(root, (draft) => { return produce(root, (draft) => {
let current = draft; let current = draft;
while (current) { while (current) {