From 87401b855782bc97a6f34e6e8d1afe5ea4a47ed4 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Thu, 25 Jan 2024 00:12:49 -0800
Subject: fix(sequelspy): log in restriction

---
 src/lib/Tools/SequelSpy.svelte | 104 +++++++++++++++++++++--------------------
 1 file changed, 54 insertions(+), 50 deletions(-)

(limited to 'src/lib/Tools/SequelSpy.svelte')

diff --git a/src/lib/Tools/SequelSpy.svelte b/src/lib/Tools/SequelSpy.svelte
index 21a6ce4d..74ce07fa 100644
--- a/src/lib/Tools/SequelSpy.svelte
+++ b/src/lib/Tools/SequelSpy.svelte
@@ -43,60 +43,64 @@
 		airingTime(prequel as unknown as Media, null);
 </script>
 
-<div class="card">
-	<p>
-		<select bind:value={season}>
-			<option value="WINTER">Winter</option>
-			<option value="SPRING">Spring</option>
-			<option value="SUMMER">Summer</option>
-			<option value="FALL">Fall</option>
-		</select>
-		<input type="number" bind:value={year} />
-	</p>
+{#if user === undefined}
+	Please log in to view this page.
+{:else}
+	<div class="card">
+		<p>
+			<select bind:value={season}>
+				<option value="WINTER">Winter</option>
+				<option value="SPRING">Spring</option>
+				<option value="SUMMER">Summer</option>
+				<option value="FALL">Fall</option>
+			</select>
+			<input type="number" bind:value={year} />
+		</p>
 
-	{#await currentPrequels}
-		<p>Loading prequels ... 50%</p>
-	{:then currentPrequels}
-		<ul>
-			{#each currentPrequels as prequel}
-				<li>
-					<a
-						href={`https://anilist.co/anime/${prequel.id}`}
-						target="_blank"
-						on:mouseenter={() => {
-							const response = onMouseEnter(prequel);
+		{#await currentPrequels}
+			<p>Loading prequels ... 50%</p>
+		{:then currentPrequels}
+			<ul>
+				{#each currentPrequels as prequel}
+					<li>
+						<a
+							href={`https://anilist.co/anime/${prequel.id}`}
+							target="_blank"
+							on:mouseenter={() => {
+								const response = onMouseEnter(prequel);
 
-							hoverCoverState.hovering = response.hovering;
-							hoverCoverState.item = response.item;
-							hoverCoverState.media = response.media;
-						}}
-						on:mouseleave={() => {
-							const response = onMouseLeave();
+								hoverCoverState.hovering = response.hovering;
+								hoverCoverState.item = response.item;
+								hoverCoverState.media = response.media;
+							}}
+							on:mouseleave={() => {
+								const response = onMouseLeave();
 
-							hoverCoverState.hovering = response.hovering;
-							hoverCoverState.item = response.item;
-							hoverCoverState.media = response.media;
-						}}
-						on:mousemove={(e) => {
-							const response = onMouseMove(e, 300);
+								hoverCoverState.hovering = response.hovering;
+								hoverCoverState.item = response.item;
+								hoverCoverState.media = response.media;
+							}}
+							on:mousemove={(e) => {
+								const response = onMouseMove(e, 300);
 
-							hoverCoverState.style = response.style;
-						}}
-					>
-						<MediaTitle title={prequel.title} />
-					</a>
-					<span style="opacity: 50%;">|</span>
-					{prequel.seen}<span style="opacity: 50%;">/{prequel.episodes}</span>
-					{@html prequelAiringTime(prequel)}
-				</li>
-			{/each}
-		</ul>
-	{/await}
+								hoverCoverState.style = response.style;
+							}}
+						>
+							<MediaTitle title={prequel.title} />
+						</a>
+						<span style="opacity: 50%;">|</span>
+						{prequel.seen}<span style="opacity: 50%;">/{prequel.episodes}</span>
+						{@html prequelAiringTime(prequel)}
+					</li>
+				{/each}
+			</ul>
+		{/await}
 
-	<p />
+		<p />
 
-	The count ratio is the number of episodes you've seen of any direct prequels, and the total number
-	of episodes of all direct prequels.
-</div>
+		The count ratio is the number of episodes you've seen of any direct prequels, and the total
+		number of episodes of all direct prequels.
+	</div>
 
-<HoverCover options={hoverCoverState} width={300} />
+	<HoverCover options={hoverCoverState} width={300} />
+{/if}
-- 
cgit v1.2.3

