feat: Update Switch form data #1739 (#2029)

### What problem does this PR solve?

feat: Update Switch form data #1739
### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-08-21 12:47:24 +08:00
committed by GitHub
parent 96438ca821
commit c9d7a34690
6 changed files with 74 additions and 42 deletions

View File

@ -30,6 +30,7 @@ import {
NodeMap,
Operator,
RestrictedUpstreamMap,
SwitchElseTo,
initialArXivValues,
initialBaiduFanyiValues,
initialBaiduValues,
@ -519,6 +520,17 @@ export const useWatchNodeFormDataChange = () => {
return pre;
}, []);
// Splice the else condition of the conditional judgment to the edge list
const elseTo = form[SwitchElseTo];
if (elseTo) {
downstreamEdges.push({
id: uuid(),
source: nodeId,
target: elseTo,
sourceHandle: SwitchElseTo,
});
}
setEdgesByNodeId(nodeId, downstreamEdges);
},
[setEdgesByNodeId],