diff options
| author | Fuwn <[email protected]> | 2023-09-01 16:22:24 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-01 16:22:24 -0700 |
| commit | b31ac5a306a2766a8688b340bc0917bd82ac8137 (patch) | |
| tree | 72e8badf7503dff0aaa58d3f117983653240ff48 /src/lib/List/Due | |
| parent | chore(typescript): tighten checks (diff) | |
| download | due.moe-b31ac5a306a2766a8688b340bc0917bd82ac8137.tar.xz due.moe-b31ac5a306a2766a8688b340bc0917bd82ac8137.zip | |
fix(due): increment first
Diffstat (limited to 'src/lib/List/Due')
| -rw-r--r-- | src/lib/List/Due/AnimeList.svelte | 6 | ||||
| -rw-r--r-- | src/lib/List/Due/MangaList.svelte | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/List/Due/AnimeList.svelte b/src/lib/List/Due/AnimeList.svelte index 2e5ca47f..17897d8d 100644 --- a/src/lib/List/Due/AnimeList.svelte +++ b/src/lib/List/Due/AnimeList.svelte @@ -123,9 +123,9 @@ }; const updateMedia = async (id: number, progress: number | undefined) => { - animeLists = mediaListCollection(user, identity, Type.Anime, $anime, $animeLastPrune, true); - - await fetch(`/anilist/increment?id=${id}&progress=${(progress || 0) + 1}`); + fetch(`/anilist/increment?id=${id}&progress=${(progress || 0) + 1}`).then(() => { + animeLists = mediaListCollection(user, identity, Type.Anime, $anime, $animeLastPrune, true); + }); }; </script> diff --git a/src/lib/List/Due/MangaList.svelte b/src/lib/List/Due/MangaList.svelte index dc2be35b..6056b9eb 100644 --- a/src/lib/List/Due/MangaList.svelte +++ b/src/lib/List/Due/MangaList.svelte @@ -97,10 +97,9 @@ const updateMedia = async (id: number, progress: number | undefined) => { await chapterDatabase.chapters.delete(id); - - mangaLists = mediaListCollection(user, identity, Type.Manga, $manga, $mangaLastPrune, true); - - await fetch(`/anilist/increment?id=${id}&progress=${(progress || 0) + 1}`); + await fetch(`/anilist/increment?id=${id}&progress=${(progress || 0) + 1}`).then(() => { + mangaLists = mediaListCollection(user, identity, Type.Manga, $manga, $mangaLastPrune, true); + }); }; </script> |