diff --git a/src/components/Graph.tsx b/src/components/Graph.tsx index 29f4ea0..5a8c284 100644 --- a/src/components/Graph.tsx +++ b/src/components/Graph.tsx @@ -264,12 +264,7 @@ const Graph = forwardRef { - const index = graphsPath.findIndex(p => p.key === pathSegmentId); - setGraphsPath(prev => { - prev.splice(index + 1); - - return [...prev]; - }); + setGraphsPath(prev => prev.slice(0, prev.findIndex(p => p.key === pathSegmentId) + 1)); selectGraphId(pathSegmentId); } } as BreadcrumbItemType;