diff options
| author | Fuwn <[email protected]> | 2024-01-30 21:50:44 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-01-30 21:50:44 -0800 |
| commit | 0191de155936da3d7c0fa503ab93ab542571f585 (patch) | |
| tree | 0b887df7a7ed04a19cc7ecfa1f00a523ba1b0045 /src/routes | |
| parent | feat(list): use last size as skeleton size (diff) | |
| download | due.moe-0191de155936da3d7c0fa503ab93ab542571f585.tar.xz due.moe-0191de155936da3d7c0fa503ab93ab542571f585.zip | |
refactor(anime): global subsPlease cache
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/+layout.svelte | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index dc7cbd15..ab9bd40a 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -19,6 +19,7 @@ import type { LocaleDictionary } from '$lib/Locale/layout'; import locale from '$stores/locale'; import Skeleton from '$lib/Skeleton.svelte'; + import subsPlease from '$stores/subsPlease'; export let data; @@ -68,6 +69,15 @@ getUserIdentity(data.user).then((h) => { if ($userIdentity.id === -2) userIdentity.set(h); }); + + if (!$subsPlease) + subsPlease.set( + await ( + await fetch( + root(`/api/subsplease?tz=${Intl.DateTimeFormat().resolvedOptions().timeZone}`) + ) + ).json() + ); }); </script> |