From d107d56f82b44592512e46c8ef1f8673eda5df8e Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 2 Dec 2025 11:29:09 -0800 Subject: [PATCH] fix collection nav link to point to user's collection The Collection nav link now points to /{username}/collection/characters instead of /collection. Also updates isNavSelected to properly detect when on any collection page. --- src/lib/components/Navigation.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/components/Navigation.svelte b/src/lib/components/Navigation.svelte index 16ccc77c..80e99e29 100644 --- a/src/lib/components/Navigation.svelte +++ b/src/lib/components/Navigation.svelte @@ -41,7 +41,9 @@ // Localized links const galleryHref = $derived(localizeHref('/teams/explore')) const guidesHref = $derived(localizeHref('/guides')) - const collectionHref = $derived(localizeHref('/collection')) + const collectionHref = $derived( + username ? localizeHref(`/${username}/collection/characters`) : localizeHref('/collection') + ) const meHref = $derived(localizeHref('/me')) const loginHref = $derived(localizeHref('/auth/login')) const registerHref = $derived(localizeHref('/auth/register')) @@ -101,6 +103,11 @@ return path === href } + // For collection, check if we're on any collection page + if (href === collectionHref) { + return path.includes('/collection') + } + // Exact match or starts with href + / return path === href || path.startsWith(href + '/') }