aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-02-16 22:56:45 -0800
committerFuwn <[email protected]>2024-02-16 22:56:45 -0800
commite81396c0d2d7380aac3d28a9a2eec6c392eddf65 (patch)
tree6ebdc2557f0143a761046521cd809ed8c2cb4314 /src
parentfix(match): exclude sai-kyo-oh (diff)
downloaddue.moe-e81396c0d2d7380aac3d28a9a2eec6c392eddf65.tar.xz
due.moe-e81396c0d2d7380aac3d28a9a2eec6c392eddf65.zip
refactor(hololive): single pinned fetch
Diffstat (limited to 'src')
-rw-r--r--src/routes/hololive/+page.svelte16
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;