From 98c063e09cb8cb9b238b38863be3f78cbd54cfba Mon Sep 17 00:00:00 2001 From: Leif Riksheim Date: Fri, 3 Feb 2023 15:53:36 +0100 Subject: [PATCH] Fix infinite loop --- views/graph-view/src/components/CommunityGraph.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/views/graph-view/src/components/CommunityGraph.tsx b/views/graph-view/src/components/CommunityGraph.tsx index 08a1c0885..45a1de83e 100644 --- a/views/graph-view/src/components/CommunityGraph.tsx +++ b/views/graph-view/src/components/CommunityGraph.tsx @@ -16,6 +16,10 @@ function findNodes(links, source) { if (alreadyIn) return acc; + if (hasSource && link.data.source === link.data.target) { + return [...acc, link]; + } + if (hasSource) { const newLinks = findNodes(links, link.data.target); return [...acc, ...newLinks, link];