From 50dff7ef3600a2089ba09c12d4ea2c8e272231e5 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Wed, 25 Sep 2024 10:00:36 +0500 Subject: [PATCH] fix(node-types): duplicate node types at sidebar filter pannel --- src/components/App/SideBar/FilterSearch/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/App/SideBar/FilterSearch/index.tsx b/src/components/App/SideBar/FilterSearch/index.tsx index 44e9e7ae8..874faaf24 100644 --- a/src/components/App/SideBar/FilterSearch/index.tsx +++ b/src/components/App/SideBar/FilterSearch/index.tsx @@ -69,6 +69,10 @@ export const FilterSearch = ({ showAllSchemas, setShowAllSchemas, schemaAll, anc await fetchData(setBudget, setAbortRequests) } + const uniqueSchemas = (showAllSchemas ? schemaAll : schemaAll.slice(0, 4)).filter( + (schema, index, self) => index === self.findIndex((s) => s.type === schema.type), + ) + return ( - {(showAllSchemas ? schemaAll : schemaAll.slice(0, 4)).map((schema) => ( + {uniqueSchemas.map((schema) => (