From 3214a2ed1c81a2ef39a5b6123c713a31b11c3222 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 22 Oct 2023 13:00:12 -0700
Subject: feat(tools): default selection query

---
 src/routes/tools/+page.svelte | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

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

diff --git a/src/routes/tools/+page.svelte b/src/routes/tools/+page.svelte
index 75bf5a40..8ddc0aac 100644
--- a/src/routes/tools/+page.svelte
+++ b/src/routes/tools/+page.svelte
@@ -6,14 +6,13 @@
 
 	export let data;
 
-	let tool = browser
-		? String(new URLSearchParams(window.location.search).get('tool')) || 'default'
-		: 'default';
+	const urlParameters = browser ? new URLSearchParams(window.location.search) : null;
+	let tool = browser && urlParameters?.size !== 0 ? urlParameters?.get('tool') : 'default';
 </script>
 
 <p>
 	<select bind:value={tool}>
-		<option value="default">Tools</option>
+		<option value="default" selected disabled hidden>Tool</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>
-- 
cgit v1.2.3

