From 21a85d3ffffb615de3b7f8faaaea93f9bf6cd7c2 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 7 Sep 2023 23:11:29 -0700 Subject: fix(user): no eager fetch --- src/routes/@[user]/+page.svelte | 50 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/routes/@[user]/+page.svelte b/src/routes/@[user]/+page.svelte index 758b52e7..1763193a 100644 --- a/src/routes/@[user]/+page.svelte +++ b/src/routes/@[user]/+page.svelte @@ -1,35 +1,21 @@ -{#await user(data.username)} - Loading ... -{:then profile} - {#if profile === null} - Could not load user profile for @{data.username}. - -

- - Does this user exist? - {:else} - @{profile.name} - -

- - This user has watched {(profile.statistics.anime.minutesWatched / 60 / 24).toFixed(1)} days of anime - and read - {((profile.statistics.manga.chaptersRead * 8.58) / 60 / 24).toFixed(1)} days of manga. - {/if} -{:catch} +{#if userData === null} Could not load user profile for @{data.username} Does this user exist? -{/await} +{:else if userData === undefined} + Loading ... +{:else} + @{userData.name} + +

+ + This user has watched {(userData.statistics.anime.minutesWatched / 60 / 24).toFixed(1)} days of anime + and read + {((userData.statistics.manga.chaptersRead * 8.58) / 60 / 24).toFixed(1)} days of manga. +{/if}

-- cgit v1.2.3