From f34de9760850489d8f08eddb9bd33a41beda4771 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.net>
Date: Thu, 4 Jun 2026 09:28:32 +0000
Subject: fix(lists): tick count down when media leaves a list

On revalidation the {#await} branch swaps and remounts CleanAnimeList,
resetting NumberTicker's tween to 0 so it always counted up. Persist the
last displayed count in AnimeListTemplate (which survives the remount) and
feed it as the ticker's start, so the count animates in the real
direction: down when an item leaves due/upcoming, up when one arrives.
---
 src/lib/List/Anime/AnimeListTemplate.svelte | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src/lib/List/Anime/AnimeListTemplate.svelte')

diff --git a/src/lib/List/Anime/AnimeListTemplate.svelte b/src/lib/List/Anime/AnimeListTemplate.svelte
index ae7ee1f1..5d769640 100644
--- a/src/lib/List/Anime/AnimeListTemplate.svelte
+++ b/src/lib/List/Anime/AnimeListTemplate.svelte
@@ -34,6 +34,7 @@ export let limit: number | undefined = undefined;
 
 let lastUpdatedMedia = -1;
 let previousAnimeList: Media[];
+let previousCount: number | undefined;
 let pendingUpdate: number | null = null;
 let lastListSize = 8;
 
@@ -74,6 +75,7 @@ onMount(async () => {
         {notYetReleased}
         {upcoming}
         bind:previousAnimeList
+        bind:previousCount
         bind:pendingUpdate
         {dummy}
         {disableFilter}
@@ -97,6 +99,7 @@ onMount(async () => {
         {notYetReleased}
         {upcoming}
         bind:previousAnimeList
+        bind:previousCount
         bind:pendingUpdate
         {dummy}
         {disableFilter}
-- 
cgit v1.2.3

