From 08b4a4593c9a5c2d3f4afdf51e62b8e7955a79ca Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Thu, 7 Dec 2023 03:42:25 -0800
Subject: fix(settings): types

---
 src/routes/settings/+page.svelte | 67 ++++++++++++++++++++--------------------
 1 file changed, 33 insertions(+), 34 deletions(-)

(limited to 'src/routes/settings/+page.svelte')

diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte
index 0234c12c..c8b9dafa 100644
--- a/src/routes/settings/+page.svelte
+++ b/src/routes/settings/+page.svelte
@@ -20,6 +20,38 @@
 		anime.set('');
 		await chapterDatabase.chapters.bulkDelete(ids);
 	};
+
+	const onHelperChange = () => {
+		const mai = document.getElementById('mai') as HTMLImageElement;
+
+		if (!mai) return;
+
+		mai.style.display = 'block';
+
+		switch ($settings.displayAoButa) {
+			case 'mai':
+				{
+					mai.src = '/aobuta/mai.png';
+				}
+				break;
+			case 'nodoka':
+				{
+					mai.src = '/aobuta/nodoka.webp';
+				}
+				break;
+			case 'kaede':
+				{
+					mai.src = '/aobuta/kaede.png';
+				}
+				break;
+			case 'none': {
+				{
+					mai.style.display = 'none';
+				}
+				break;
+			}
+		}
+	};
 </script>
 
 <p>
@@ -100,40 +132,7 @@
 
 		<br />
 
-		<select
-			bind:value={$settings.displayAoButa}
-			on:change={() => {
-				const mai = document.getElementById('mai');
-
-				if (!mai) return;
-
-				mai.style.display = 'block';
-
-				switch ($settings.displayAoButa) {
-					case 'mai':
-						{
-							mai.src = '/aobuta/mai.png';
-						}
-						break;
-					case 'nodoka':
-						{
-							mai.src = '/aobuta/nodoka.webp';
-						}
-						break;
-					case 'kaede':
-						{
-							mai.src = '/aobuta/kaede.png';
-						}
-						break;
-					case 'none': {
-						{
-							mai.style.display = 'none';
-						}
-						break;
-					}
-				}
-			}}
-		>
+		<select bind:value={$settings.displayAoButa} on:change={onHelperChange}>
 			<option value="mai">Mai</option>
 			<option value="nodoka">Nodoka</option>
 			<option value="kaede">Kaede</option>
-- 
cgit v1.2.3

