Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Christofon committed Apr 1, 2023
1 parent 07f22a2 commit d9d53dd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,16 @@ function App() {
const [edges, setEdges, onEdgesChange] = useEdgesState([]);

const onConnect = (connection: Edge<any> | Connection) => {
// Check the lineage of the source node to make
// sure we aren't creating a recursive connection.

if (
// Check the lineage of the source node to make
// sure we aren't creating a recursive connection.
isFluxNodeInLineage(nodes, edges, {
nodeToCheck: connection.target!,
nodeToGetLineageOf: connection.source!,
})
}) ||
// Check if the target node already has a parent.
getFluxNodeParent(nodes, edges, connection.target!) !== undefined
)
return;

Expand Down

0 comments on commit d9d53dd

Please sign in to comment.