From cc331b59be0da7e8174ff2c420cd8d51e51ee419 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 1 Oct 2023 02:14:57 -0700
Subject: feat(list): colour last updated media if remains

---
 src/lib/List/Anime/CleanAnimeList.svelte | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

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

diff --git a/src/lib/List/Anime/CleanAnimeList.svelte b/src/lib/List/Anime/CleanAnimeList.svelte
index 18700991..59303e6a 100644
--- a/src/lib/List/Anime/CleanAnimeList.svelte
+++ b/src/lib/List/Anime/CleanAnimeList.svelte
@@ -11,6 +11,8 @@
 	export let user: AniListAuthorisation;
 	export let identity: UserIdentity;
 	export let endTime: number;
+
+	let lastUpdatedMedia = -1;
 </script>
 
 <ListTitle time={endTime / 1000} count={media.length} custom={title} />
@@ -36,7 +38,13 @@
 					  }`}
 				target="_blank"
 			>
-				{anime.title.english || anime.title.romaji || anime.title.native}
+				{#if lastUpdatedMedia === anime.id}
+					<span style="color: lightcoral">
+						{anime.title.english || anime.title.romaji || anime.title.native}
+					</span>
+				{:else}
+					{anime.title.english || anime.title.romaji || anime.title.native}
+				{/if}
 			</a>
 			<span style="opacity: 50%;">|</span>
 			{#if title !== 'Upcoming Episodes'}
@@ -45,11 +53,10 @@
 				<a
 					href={'#'}
 					on:click={() =>
-						updateMedia(
-							anime.id,
-							anime.mediaListEntry?.progress,
-							() => (animeLists = cleanCache(user, identity))
-						)}>+</a
+						updateMedia(anime.id, anime.mediaListEntry?.progress, () => {
+							animeLists = cleanCache(user, identity);
+							lastUpdatedMedia = anime.id;
+						})}>+</a
 				>
 				{#if !title.includes('Completed')}
 					[{anime.nextAiringEpisode?.episode === -1
-- 
cgit v1.2.3

