fix(reactflowUtils.ts): only add updated edges to the array if they are connected to the group node

This commit is contained in:
anovazzi1 2023-09-14 20:47:36 -03:00
commit c0befa83ac

View file

@ -744,7 +744,9 @@ export function ungroupNode(
newEdge.data.sourceHandle = newSourceHandle;
newEdge.sourceHandle = scapedJSONStringfy(newSourceHandle);
}
updatedEdges.push(newEdge);
if(newEdge.target === groupNode.id || newEdge.source === groupNode.id){
updatedEdges.push(newEdge);
}
});
//update template values
Object.keys(template).forEach((key) => {
@ -828,7 +830,9 @@ export function expandGroupNode(
newEdge.data.sourceHandle = newSourceHandle;
newEdge.sourceHandle = scapedJSONStringfy(newSourceHandle);
}
updatedEdges.push(newEdge);
if(newEdge.target === groupNode.id || newEdge.source === groupNode.id){
updatedEdges.push(newEdge);
}
});
//update template values
Object.keys(template).forEach((key) => {