From e045c18b7debec69a6497aa01db9d18a3078cdf8 Mon Sep 17 00:00:00 2001 From: Oliver Schwamb Date: Fri, 5 Jul 2024 10:50:32 +0200 Subject: [PATCH] Only show tags within collection --- pages/public/collections/[id].tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pages/public/collections/[id].tsx b/pages/public/collections/[id].tsx index 7601856..a75f47f 100644 --- a/pages/public/collections/[id].tsx +++ b/pages/public/collections/[id].tsx @@ -44,6 +44,7 @@ const cardVariants: Variants = { export default function PublicCollections() { const { links } = useLinkStore(); + const tagsInCollection = links.map(l => l.tags).flat(); const { settings } = useLocalSettingsStore(); @@ -241,7 +242,7 @@ export default function PublicCollections() { -{collection.tagsArePublic && tags[0] && ( +{collection.tagsArePublic && tagsInCollection[0] && (

Browse by topic

@@ -257,7 +258,7 @@ export default function PublicCollections() {
- {tags + {tagsInCollection .sort((a, b) => a.name.localeCompare(b.name)) .map((e, i) => { const active = router.query.q === e.name; @@ -274,7 +275,7 @@ export default function PublicCollections() {

{e.name}

- {e._count?.links} + {tags.find(t => t.id === e.id)?._count?.links}