From 34d00fff30c6207c71f37c4da81f4d28e4c646b7 Mon Sep 17 00:00:00 2001 From: Anchel135 Date: Mon, 18 Nov 2024 14:15:10 +0200 Subject: [PATCH] don't call the handel select if the elements and the length match --- app/components/chat.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index c2df1aa0..0051941f 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -436,7 +436,7 @@ export function Chat({ repo, path, setPath, graph, chartRef, selectedPathId, isP key={i} className={cn("flex text-wrap border p-2 gap-2 rounded-md", p.nodes.length === selectedPath?.nodes.length && selectedPath?.nodes.every(node => p?.nodes.some((n) => n.id === node.id)) && "border-[#FF66B3] bg-[#FFF0F7]")} onClick={() => { - if (selectedPath?.nodes.every(node => p?.nodes.some((n) => n.id === node.id))) return + if (p.nodes.length === selectedPath?.nodes.length && selectedPath?.nodes.every(node => p?.nodes.some((n) => n.id === node.id))) return handelSetSelectedPath(p) setIsPath(true) }}