aboutsummaryrefslogtreecommitdiff
path: root/src/lib/List/Anime/CleanAnimeList.svelte
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-05-25 08:41:20 +0000
committerFuwn <[email protected]>2026-05-25 08:41:20 +0000
commitbb7085f697e7ee61fb41a669dd87ce71b1b704b2 (patch)
treee38535cd14bf46cfca894e30d08534a018482025 /src/lib/List/Anime/CleanAnimeList.svelte
parentfix(locale): deep-merge fallback into partial namespace returns (diff)
downloaddue.moe-bb7085f697e7ee61fb41a669dd87ce71b1b704b2.tar.xz
due.moe-bb7085f697e7ee61fb41a669dd87ce71b1b704b2.zip
fix(lists): pass pre-mutation progress to anime increment mutationHEADmain
The optimistic local bump mutated anime.mediaListEntry.progress before the API call read it, so the GraphQL mutation's own +1 landed on the already-incremented value and advanced progress by two.
Diffstat (limited to 'src/lib/List/Anime/CleanAnimeList.svelte')
-rw-r--r--src/lib/List/Anime/CleanAnimeList.svelte15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/lib/List/Anime/CleanAnimeList.svelte b/src/lib/List/Anime/CleanAnimeList.svelte
index 5cb6cb1e..e27378eb 100644
--- a/src/lib/List/Anime/CleanAnimeList.svelte
+++ b/src/lib/List/Anime/CleanAnimeList.svelte
@@ -225,16 +225,11 @@ const increment = (anime: Media, progress: number) => {
? media.filter((m) => m.id !== anime.id)
: media;
- incrementMediaProgress(
- anime.id,
- anime.mediaListEntry?.progress,
- user,
- (skipped) => {
- pendingUpdate = null;
-
- if (!skipped) $revalidateAnime = $revalidateAnime + 1;
- },
- );
+ incrementMediaProgress(anime.id, progress, user, (skipped) => {
+ pendingUpdate = null;
+
+ if (!skipped) $revalidateAnime = $revalidateAnime + 1;
+ });
};
</script>