From 7cd0fc0bb78f3fba38da69f669c5ec3c35d0dab3 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Tue, 3 Oct 2023 14:47:58 -0700
Subject: feat(anime): disable increment on refresh

---
 src/lib/List/Anime/CleanAnimeList.svelte | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 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 40a27d90..398ed541 100644
--- a/src/lib/List/Anime/CleanAnimeList.svelte
+++ b/src/lib/List/Anime/CleanAnimeList.svelte
@@ -16,6 +16,7 @@
 	export let lastUpdatedMedia: number;
 	export let completed = false;
 	export let previousAnimeList: Media[];
+	export let disableIncrement = false;
 </script>
 
 <ListTitle time={endTime / 1000} count={media.length} custom={title} />
@@ -55,12 +56,15 @@
 				{(anime.mediaListEntry || { progress: 0 }).progress}{@html totalEpisodes(anime)}
 				<a
 					href={'#'}
+					style={disableIncrement ? 'pointer-events: none; opacity: 50%;' : ''}
 					on:click={() =>
-						updateMedia(anime.id, anime.mediaListEntry?.progress, () => {
-							previousAnimeList = media;
-							animeLists = cleanCache(user, identity);
-							lastUpdatedMedia = anime.id;
-						})}>+</a
+						disableIncrement
+							? null
+							: updateMedia(anime.id, anime.mediaListEntry?.progress, () => {
+									previousAnimeList = media;
+									animeLists = cleanCache(user, identity);
+									lastUpdatedMedia = anime.id;
+							  })}>+</a
 				>
 				{#if !completed}
 					[{anime.nextAiringEpisode?.episode === -1
-- 
cgit v1.2.3

