From 5ef3b70385d095914c199e230f16cc19d505ee32 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 19 Jun 2024 16:31:05 -0300 Subject: [PATCH] update cleanEdges --- src/frontend/src/utils/reactflowUtils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frontend/src/utils/reactflowUtils.ts b/src/frontend/src/utils/reactflowUtils.ts index 7aa6a6ff1..80d9f11a0 100644 --- a/src/frontend/src/utils/reactflowUtils.ts +++ b/src/frontend/src/utils/reactflowUtils.ts @@ -48,6 +48,7 @@ export function checkChatInput(nodes: Node[]) { } export function cleanEdges(nodes: NodeType[], edges: Edge[]) { + console.log("cleanEdges", nodes, edges); let newEdges = cloneDeep(edges); edges.forEach((edge) => { // check if the source and target node still exists @@ -98,6 +99,9 @@ export function cleanEdges(nodes: NodeType[], edges: Edge[]) { newEdges = newEdges.filter((e) => e.id !== edge.id); } } + else { + newEdges = newEdges.filter((e) => e.id !== edge.id); + } } }); return newEdges;