Skip to content

Commit

Permalink
Fix infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
leifriksheim committed Feb 3, 2023
1 parent 55d56d9 commit 98c063e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions views/graph-view/src/components/CommunityGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 98c063e

Please sign in to comment.