diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/Data/AniList/following.ts | 6 | ||||
| -rw-r--r-- | src/lib/Data/AniList/forum.ts | 6 | ||||
| -rw-r--r-- | src/lib/List/Manga/MangaListTemplate.svelte | 2 | ||||
| -rw-r--r-- | src/lib/Tools/BirthdaysTemplate.svelte | 2 | ||||
| -rw-r--r-- | src/lib/Tools/Tracker/Tool.svelte | 7 |
5 files changed, 18 insertions, 5 deletions
diff --git a/src/lib/Data/AniList/following.ts b/src/lib/Data/AniList/following.ts index b4772afa..bec1f53c 100644 --- a/src/lib/Data/AniList/following.ts +++ b/src/lib/Data/AniList/following.ts @@ -33,7 +33,11 @@ const followingPage = async (page: number, id: number): Promise<FollowingPage> = export const followers = async (name: string): Promise<Partial<User>[]> => { const activities = []; let page = 1; - const id = (await user(name)).id; + const userData = await user(name); + + if (!userData) throw new Error(`User not found: ${name}`); + + const id = userData.id; let currentPage = await followingPage(page, id); for (const activity of currentPage.data.Page.following) activities.push(activity); diff --git a/src/lib/Data/AniList/forum.ts b/src/lib/Data/AniList/forum.ts index b2467c9e..c8514fe1 100644 --- a/src/lib/Data/AniList/forum.ts +++ b/src/lib/Data/AniList/forum.ts @@ -47,7 +47,11 @@ const threadPage = async (page: number, userId: number): Promise<ThreadPage> => export const threads = async (username: string): Promise<Thread[]> => { const allThreads = []; - const userId = (await user(username)).id; + const userData = await user(username); + + if (!userData) throw new Error(`User not found: ${username}`); + + const userId = userData.id; let page = 1; let currentPage = await threadPage(page, userId); diff --git a/src/lib/List/Manga/MangaListTemplate.svelte b/src/lib/List/Manga/MangaListTemplate.svelte index 3fee9f6a..16665d56 100644 --- a/src/lib/List/Manga/MangaListTemplate.svelte +++ b/src/lib/List/Manga/MangaListTemplate.svelte @@ -61,7 +61,7 @@ `last${due ? '' : 'Completed'}MangaListLength` )) as number | null; - if (lastStoredList) lastListSize = parseInt(lastStoredList); + if (lastStoredList) lastListSize = parseInt(String(lastStoredList)); } startTime = performance.now(); diff --git a/src/lib/Tools/BirthdaysTemplate.svelte b/src/lib/Tools/BirthdaysTemplate.svelte index 951de5cf..daf4c5af 100644 --- a/src/lib/Tools/BirthdaysTemplate.svelte +++ b/src/lib/Tools/BirthdaysTemplate.svelte @@ -44,7 +44,7 @@ <Skeleton grid={true} count={100} width="150px" height="170px" /> {:then birthdays} {@const todaysBirthdays = birthdays.filter( - (birthday) => birthday.month === month && birthday.day === day + (birthday: { month: number; day: number }) => birthday.month === month && birthday.day === day )} <p> diff --git a/src/lib/Tools/Tracker/Tool.svelte b/src/lib/Tools/Tracker/Tool.svelte index 6c7fbf1c..a3705fbe 100644 --- a/src/lib/Tools/Tracker/Tool.svelte +++ b/src/lib/Tools/Tracker/Tool.svelte @@ -97,7 +97,12 @@ value={entry.progress} size={3} onchange={(e) => - adjustEntry(entry.id, e.target ? e.target.value || entry.progress : entry.progress)} + adjustEntry( + entry.id, + e.target + ? Number((e.target as HTMLInputElement).value) || entry.progress + : entry.progress + )} /> <span class="entry-adjust"> |