From bb7085f697e7ee61fb41a669dd87ce71b1b704b2 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 25 May 2026 08:41:20 +0000 Subject: fix(lists): pass pre-mutation progress to anime increment mutation 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. --- src/lib/List/Anime/CleanAnimeList.svelte | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/lib/List') 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; + }); }; -- cgit v1.2.3