diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/AniList/media.ts | 9 | ||||
| -rw-r--r-- | src/routes/+layout.svelte | 24 |
2 files changed, 22 insertions, 11 deletions
diff --git a/src/lib/AniList/media.ts b/src/lib/AniList/media.ts index e65c90cd..b9d511bc 100644 --- a/src/lib/AniList/media.ts +++ b/src/lib/AniList/media.ts @@ -187,6 +187,8 @@ export const mediaListCollection = async ( currentLastPruneAt: string | number, inputOptions: CollectionOptions = {} ): Promise<Media[]> => { + if (userIdentity.id === -1 || userIdentity.id === -2) return []; + const options = assignDefaultOptions(inputOptions); let currentCacheMinutes; @@ -230,6 +232,13 @@ export const mediaListCollection = async ( }) ).json(); + if ( + !userIdResponse['data'] || + !userIdResponse['data']['MediaListCollection'] || + !userIdResponse['data']['MediaListCollection']['lists'] + ) + return []; + if (mediaCache === '') if (type === Type.Anime) anime.set( diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 059d1e60..4709a975 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -140,17 +140,19 @@ <p /> <Notifications item={Notification} zIndex={5000}> - {#if $userIdentity.id !== -1} - <Root {data} {way}><slot /></Root> - {:else if data.url === '/settings'} - <Skeleton /> - {:else if data.url === '/tools'} - <Skeleton count={1} height="75vh" /> - {:else if data.url === '/schedule'} - <Skeleton grid={true} width="50%" count={2} height="25vh" /> - {:else} - <Skeleton grid={true} width="50%" count={2} height="25vh" /> - {/if} + <Root {data} {way}> + {#if $userIdentity.id !== -1} + <slot /> + {:else if data.url === '/settings'} + <Skeleton /> + {:else if data.url === '/tools'} + <Skeleton count={1} height="75vh" /> + {:else if data.url === '/schedule'} + <Skeleton grid={true} width="50%" count={2} height="25vh" /> + {:else} + <Skeleton grid={true} width="50%" count={2} height="25vh" /> + {/if} + </Root> </Notifications> </div> |