From 9d248c3c534a6d0e9f79c3d275aac246743c4daf Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Mon, 23 Oct 2023 18:01:16 -0500 Subject: [PATCH] fix `wordMatches` array for `ToolSearch` make sure, it is a Set (no duplicate matches) --- client/src/components/Panels/utilities.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Panels/utilities.ts b/client/src/components/Panels/utilities.ts index ff75e194b13d..8bda77394f33 100644 --- a/client/src/components/Panels/utilities.ts +++ b/client/src/components/Panels/utilities.ts @@ -291,7 +291,7 @@ export function searchToolsByKeys( ? keys.startsWith : order; - const wordMatches = actualValueWords.filter((word) => queryWords.includes(word)); + const wordMatches = Array.from(new Set(actualValueWords.filter((word) => queryWords.includes(word)))); if (!usesDL) { if (actualValue.match(queryValue)) { // if string.match() returns true, matching tool found