From fde97af90a50ae6bde8fbbeffb3ce539579222e6 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 27 Aug 2023 01:35:20 -0700
Subject: feat(list): loading ui changes

---
 src/lib/List/Due/AnimeList.svelte | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

(limited to 'src/lib/List/Due/AnimeList.svelte')

diff --git a/src/lib/List/Due/AnimeList.svelte b/src/lib/List/Due/AnimeList.svelte
index 45b5eb11..f9e7d11e 100644
--- a/src/lib/List/Due/AnimeList.svelte
+++ b/src/lib/List/Due/AnimeList.svelte
@@ -107,17 +107,19 @@
 </script>
 
 {#await animeLists}
-	<summary>Anime</summary>
+	<summary>Anime [...] <small style="opacity: 50%">...s</small></summary>
 
 	<ul><li>Loading ...</li></ul>
 {:then media}
+	{@const cleanedMedia = cleanMedia(media, displayUnresolved)}
+
 	<summary
-		>Anime [{cleanMedia(media, displayUnresolved).length}]
+		>Anime [{cleanedMedia.length}]
 		<small style="opacity: 50%">{endTime / 1000}s</small></summary
 	>
 
 	<ul>
-		{#each cleanMedia(media, displayUnresolved) as anime}
+		{#each cleanedMedia as anime}
 			<li>
 				<a href={`https://anilist.co/anime/${anime['id']}`} target="_blank">
 					{anime['title']['english'] || anime['title']['romaji']}
@@ -131,4 +133,12 @@
 			</li>
 		{/each}
 	</ul>
+{:catch}
+	<ul>
+		<li>
+			Media could not be loaded. You might have been <a
+				href="https://en.wikipedia.org/wiki/Rate_limiting">rate limited</a
+			>.
+		</li>
+	</ul>
 {/await}
-- 
cgit v1.2.3

