diff options
| author | Fuwn <[email protected]> | 2024-02-16 22:56:45 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-02-16 22:56:45 -0800 |
| commit | e81396c0d2d7380aac3d28a9a2eec6c392eddf65 (patch) | |
| tree | 6ebdc2557f0143a761046521cd809ed8c2cb4314 /src | |
| parent | fix(match): exclude sai-kyo-oh (diff) | |
| download | due.moe-e81396c0d2d7380aac3d28a9a2eec6c392eddf65.tar.xz due.moe-e81396c0d2d7380aac3d28a9a2eec6c392eddf65.zip | |
refactor(hololive): single pinned fetch
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/hololive/+page.svelte | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/routes/hololive/+page.svelte b/src/routes/hololive/+page.svelte index 34783fdf..771bc808 100644 --- a/src/routes/hololive/+page.svelte +++ b/src/routes/hololive/+page.svelte @@ -37,23 +37,27 @@ } onMount(async () => { - schedulePromise = fetch(proxy('https://schedule.hololive.tv'), { - headers: { - Cookie: 'timezone=Asia/Tokyo' - } - }); + // schedulePromise = fetch(proxy('https://schedule.hololive.tv'), { + // headers: { + // Cookie: 'timezone=Asia/Tokyo' + // } + // }); getPinnedStreams(); }); const getPinnedStreams = () => { + let streams: string[] = []; + if ($identity.id !== -2) fetch(root(`/api/configuration?id=${$identity.id}`)).then((response) => { if (response.ok) response.json().then((data) => { - if (data && data.configuration) pinnedStreams = data.pinned_hololive_streams; + if (data && data.configuration) streams = data.pinned_hololive_streams; }); }); + + pinnedStreams = streams; }; const typeSchedule = (schedule: any) => schedule as ParseResult; |