diff --git a/src/App.svelte b/src/App.svelte index 9c77ec1..9a7fa65 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -55,15 +55,12 @@ applyTheme(); } - // Compute all unique tags as objects with text and optional color + // Compute all unique tags as strings $: allTags = Array.from( - new Map( - logos.flatMap(logo => (logo.tags || []).map(tag => { - if (typeof tag === 'string') return [tag, { text: tag }]; - return [tag.text, tag]; - })) - ).values() - ).sort((a, b) => a.text.localeCompare(b.text)); + new Set( + logos.flatMap(logo => (logo.tags || [])) + ) + ).map(tag => typeof tag === 'object' ? tag.text : tag); $: filteredLogos = logos.filter(logo => { const matchesSearch = logo.name.toLowerCase().includes(searchQuery.toLowerCase()); @@ -179,7 +176,7 @@ } function getTagObj(text) { - return allTags.find(t => t.text === text); + return { text }; } // Listen for outside click to close dropdown @@ -215,17 +212,14 @@