diff options
| author | Fuwn <[email protected]> | 2025-05-06 06:11:15 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-05-06 06:11:15 -0700 |
| commit | 79c16c682ea3699eaeb52b509510737c47095c2f (patch) | |
| tree | 4055f7b185b31d1700d0b47d8fc52b6ca75912d4 /src | |
| parent | feat: Add command palette (diff) | |
| download | due.moe-79c16c682ea3699eaeb52b509510737c47095c2f.tar.xz due.moe-79c16c682ea3699eaeb52b509510737c47095c2f.zip | |
feat: Add Badge Wall action to command palette
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/CommandPalette/actions.ts | 4 | ||||
| -rw-r--r-- | src/routes/user/+page.svelte | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/CommandPalette/actions.ts b/src/lib/CommandPalette/actions.ts index 73128a2c..de24fb7d 100644 --- a/src/lib/CommandPalette/actions.ts +++ b/src/lib/CommandPalette/actions.ts @@ -30,5 +30,9 @@ export const defaultActions = [ { name: 'My Profile', url: '/user' + }, + { + name: 'My Badge Wall', + url: '/user?badges=1' } ]; diff --git a/src/routes/user/+page.svelte b/src/routes/user/+page.svelte index 8db13d7d..29bd132b 100644 --- a/src/routes/user/+page.svelte +++ b/src/routes/user/+page.svelte @@ -6,6 +6,7 @@ import { env } from '$env/dynamic/public'; import HeadTitle from '$lib/Home/HeadTitle.svelte'; import root from '$lib/Utility/root'; + import { page } from '$app/stores'; const user = browser && localStorage.getItem('identity') @@ -14,7 +15,11 @@ onMount(() => { if (user) { - goto(root(`/user/${user}`)); + if (browser && $page.url.searchParams.get('badges') !== null) { + goto(root(`/user/${user}/badges`)); + } else { + goto(root(`/user/${user}`)); + } } else { goto( `https://anilist.co/api/v2/oauth/authorize?client_id=${env.PUBLIC_ANILIST_CLIENT_ID}&redirect_uri=${env.PUBLIC_ANILIST_REDIRECT_URI}&response_type=code` |