diff options
| author | Fuwn <[email protected]> | 2024-10-09 00:41:20 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-09 00:41:43 -0700 |
| commit | 998b63a35256ac985a5a2714dd1ca451af4dfd8a (patch) | |
| tree | 50796121a9d5ab0330fdc5d7e098bda2860d9726 /src/routes/user/+page.svelte | |
| parent | feat(graphql): add badgeCount field (diff) | |
| download | due.moe-998b63a35256ac985a5a2714dd1ca451af4dfd8a.tar.xz due.moe-998b63a35256ac985a5a2714dd1ca451af4dfd8a.zip | |
chore(prettier): use spaces instead of tabs
Diffstat (limited to 'src/routes/user/+page.svelte')
| -rw-r--r-- | src/routes/user/+page.svelte | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/routes/user/+page.svelte b/src/routes/user/+page.svelte index e66c8503..8db13d7d 100644 --- a/src/routes/user/+page.svelte +++ b/src/routes/user/+page.svelte @@ -1,26 +1,26 @@ <script lang="ts"> - import { browser } from '$app/environment'; - import { goto } from '$app/navigation'; - import type { UserIdentity } from '$lib/Data/AniList/identity'; - import { onMount } from 'svelte'; - import { env } from '$env/dynamic/public'; - import HeadTitle from '$lib/Home/HeadTitle.svelte'; - import root from '$lib/Utility/root'; + import { browser } from '$app/environment'; + import { goto } from '$app/navigation'; + import type { UserIdentity } from '$lib/Data/AniList/identity'; + import { onMount } from 'svelte'; + import { env } from '$env/dynamic/public'; + import HeadTitle from '$lib/Home/HeadTitle.svelte'; + import root from '$lib/Utility/root'; - const user = - browser && localStorage.getItem('identity') - ? (JSON.parse(localStorage.getItem('identity') || '') as UserIdentity).name - : null; + const user = + browser && localStorage.getItem('identity') + ? (JSON.parse(localStorage.getItem('identity') || '') as UserIdentity).name + : null; - onMount(() => { - if (user) { - 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` - ); - } - }); + onMount(() => { + if (user) { + 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` + ); + } + }); </script> <HeadTitle route="Profile" path="/user" /> |