From 104ef6886c5d53fdacd32710f1191d029958d723 Mon Sep 17 00:00:00 2001 From: Nick Burka Date: Sat, 23 Nov 2024 11:44:31 -0500 Subject: [PATCH] pull the correct meta data when a component name exists in two categories --- src/lib/icons.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/icons.tsx b/src/lib/icons.tsx index 5c03040b1..00fc20722 100644 --- a/src/lib/icons.tsx +++ b/src/lib/icons.tsx @@ -48,7 +48,10 @@ async function getIcons(dirName: string): Promise { fileNames.map(async (fileName) => { const id = fileName.replace(/\.[^/.]+$/, ''); - const currentFileMetaData = metaData.find((m) => m.id === id); + // find same icon id in the same category from the meta-data JSON file + const currentFileMetaData = metaData.find( + (m) => m.id === id && m.category === dirName + ); return { title: currentFileMetaData?.title || id,