From 814e8d817bf2cccb1b8a4a4ac2e9cf52b115a539 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 22 Oct 2023 11:14:05 -0700
Subject: feat(tools): use string query parameters

---
 src/routes/tools/+page.svelte | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

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

diff --git a/src/routes/tools/+page.svelte b/src/routes/tools/+page.svelte
index 3976aeba..75bf5a40 100644
--- a/src/routes/tools/+page.svelte
+++ b/src/routes/tools/+page.svelte
@@ -6,25 +6,27 @@
 
 	export let data;
 
-	let tool = browser ? Number(new URLSearchParams(window.location.search).get('tool')) || 0 : 0;
+	let tool = browser
+		? String(new URLSearchParams(window.location.search).get('tool')) || 'default'
+		: 'default';
 </script>
 
 <p>
 	<select bind:value={tool}>
-		<option value={0}>Tools</option>
-		<option value={1}>Today's Character Birthdays</option>
-		<option value={2}>Activity History Hole Risks</option>
-		<option value={3}>Wrapped (Beta)</option>
+		<option value="default">Tools</option>
+		<option value="todays_character_birthdays">Today's Character Birthdays</option>
+		<option value="activity_history_hole_risks">Activity History Hole Risks</option>
+		<option value="wrapped">Wrapped (Beta)</option>
 	</select>
 </p>
 
-{#if tool === 0}
+{#if tool === 'default'}
 	Select a tool to continue.
-{:else if tool === 2}
+{:else if tool === 'activity_history_hole_risks'}
 	<ActivityHistory user={data.user} />
-{:else if tool === 3}
+{:else if tool === 'wrapped'}
 	<div id="wrapped"><Wrapped user={data.user} /></div>
-{:else if tool === 1}
+{:else if tool === 'todays_character_birthdays'}
 	<ul>
 		{#await todaysCharacterBirthdays()}
 			<li>Loading ...</li>
-- 
cgit v1.2.3

