Merge pull request #760 from fudiwei/bugfix

bugfix: could not add branches in workflows
This commit is contained in:
RHQYZ 2025-06-03 23:48:13 +08:00 committed by GitHub
commit 2203bb5268
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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) {