From 93293176446dc4ccaf1576253f2bf43f5f4a051e Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Tue, 3 Oct 2023 20:43:49 -0700
Subject: feat(template): loading for initial load

---
 src/lib/List/Template/AnimeListTemplate.svelte | 32 +++++++++++++++-----------
 1 file changed, 19 insertions(+), 13 deletions(-)

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

diff --git a/src/lib/List/Template/AnimeListTemplate.svelte b/src/lib/List/Template/AnimeListTemplate.svelte
index 3b70b06a..85e4f1dc 100644
--- a/src/lib/List/Template/AnimeListTemplate.svelte
+++ b/src/lib/List/Template/AnimeListTemplate.svelte
@@ -17,22 +17,28 @@
 	export let completed = false;
 
 	let lastUpdatedMedia = -1;
-	let previousAnimeList: Media[] = [];
+	let previousAnimeList: Media[];
 </script>
 
 {#await animeLists}
-	<CleanAnimeList
-		media={previousAnimeList}
-		{title}
-		bind:animeLists
-		{user}
-		{identity}
-		{endTime}
-		bind:lastUpdatedMedia
-		{completed}
-		bind:previousAnimeList
-		disableIncrement
-	/>
+	{#if previousAnimeList}
+		<CleanAnimeList
+			media={previousAnimeList}
+			{title}
+			bind:animeLists
+			{user}
+			{identity}
+			{endTime}
+			bind:lastUpdatedMedia
+			{completed}
+			bind:previousAnimeList
+			disableIncrement
+		/>
+	{:else}
+		<ListTitle custom={title} />
+
+		<ul><li>Loading ...</li></ul>
+	{/if}
 {:then media}
 	{@const cleanedMedia = cleanMedia(media, $settings.displayUnresolved)}
 
-- 
cgit v1.2.3

