fix: remove connected edges when enabling tool mode for them to not reconnect later (#8047)
added tool mode cleaning on cleanEdges
This commit is contained in:
parent
199f2d91aa
commit
a01e0f265d
1 changed files with 5 additions and 1 deletions
|
|
@ -95,6 +95,7 @@ export function cleanEdges(nodes: AllNodeType[], edges: EdgeType[]) {
|
|||
const templateFieldType = targetNode.data.node!.template[field]?.type;
|
||||
const inputTypes = targetNode.data.node!.template[field]?.input_types;
|
||||
const hasProxy = targetNode.data.node!.template[field]?.proxy;
|
||||
const isToolMode = targetNode.data.node!.template[field]?.tool_mode;
|
||||
|
||||
if (
|
||||
!field &&
|
||||
|
|
@ -124,7 +125,10 @@ export function cleanEdges(nodes: AllNodeType[], edges: EdgeType[]) {
|
|||
id.proxy = targetNode.data.node!.template[field]?.proxy;
|
||||
}
|
||||
}
|
||||
if (scapedJSONStringfy(id) !== targetHandle) {
|
||||
if (
|
||||
scapedJSONStringfy(id) !== targetHandle ||
|
||||
(targetNode.data.node?.tool_mode && isToolMode)
|
||||
) {
|
||||
newEdges = newEdges.filter((e) => e.id !== edge.id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue