diff --git a/web/src/store/v1/memoMetadata.ts b/web/src/store/v1/memoMetadata.ts index 3bc2bfaf..ec39921a 100644 --- a/web/src/store/v1/memoMetadata.ts +++ b/web/src/store/v1/memoMetadata.ts @@ -59,12 +59,17 @@ export const useMemoTagList = () => { const memos = Object.values(memoStore.getState().dataMapByName); const tagAmounts: Record = {}; memos.forEach((memo) => { - memo.tags.forEach((tag) => { - if (tagAmounts[tag]) { - tagAmounts[tag] += 1; - } else { - tagAmounts[tag] = 1; + const tagSet = new Set(); + for (const tag of memo.tags) { + const parts = tag.split("/"); + let currentTag = ""; + for (const part of parts) { + currentTag = currentTag ? `${currentTag}/${part}` : part; + tagSet.add(currentTag); } + } + Array.from(tagSet).forEach((tag) => { + tagAmounts[tag] = tagAmounts[tag] ? tagAmounts[tag] + 1 : 1; }); }); return tagAmounts;