From 30fa0c4c1faece6b054105fe3cce5107f24a2fa2 Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Sun, 3 Nov 2024 15:33:43 -0500
Subject: Svelte 5: go through and use runes in components, pages, and layouts.

Does not use runes in stores (yet).
---
 ui/routes/(login)/setup/+page.svelte | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

(limited to 'ui/routes/(login)/setup/+page.svelte')

diff --git a/ui/routes/(login)/setup/+page.svelte b/ui/routes/(login)/setup/+page.svelte
index 2f098ef..f95403f 100644
--- a/ui/routes/(login)/setup/+page.svelte
+++ b/ui/routes/(login)/setup/+page.svelte
@@ -4,12 +4,13 @@
 
 	import LogIn from '$lib/components/LogIn.svelte';
 
-	let username = '',
-		password = '';
+	let username = $state(''),
+		password = $state('');
 	let pending = false;
-	$: disabled = pending;
+	let disabled = $derived(pending);
 
-	async function onSubmit() {
+	async function onSubmit(event) {
+		event.preventDefault();
 		pending = true;
 		const response = await setup(username, password);
 		if (200 <= response.status && response.status < 300) {
@@ -21,4 +22,4 @@
 	}
 </script>
 
-<LogIn bind:disabled bind:username bind:password legend="set up" on:submit={onSubmit} />
+<LogIn {disabled} bind:username bind:password legend="set up" onsubmit={onSubmit} />
-- 
cgit v1.2.3

