summaryrefslogtreecommitdiff
path: root/ui/lib/components/CreateChannelForm.svelte
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-11-03 15:33:43 -0500
committerOwen Jacobson <owen@grimoire.ca>2024-11-03 15:33:43 -0500
commit30fa0c4c1faece6b054105fe3cce5107f24a2fa2 (patch)
tree6b66eec84a702103f368f6a5ba0e96736fc56fd6 /ui/lib/components/CreateChannelForm.svelte
parentf2285a52822fbd1d82a24fe3b51c4343dc9e9ae6 (diff)
Svelte 5: go through and use runes in components, pages, and layouts.
Does not use runes in stores (yet).
Diffstat (limited to 'ui/lib/components/CreateChannelForm.svelte')
-rw-r--r--ui/lib/components/CreateChannelForm.svelte9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/lib/components/CreateChannelForm.svelte b/ui/lib/components/CreateChannelForm.svelte
index 6eee5db..ac43925 100644
--- a/ui/lib/components/CreateChannelForm.svelte
+++ b/ui/lib/components/CreateChannelForm.svelte
@@ -1,11 +1,12 @@
<script>
import { createChannel } from '$lib/apiServer';
- let name = '';
+ let name = $state('');
let pending = false;
- $: disabled = pending;
+ let disabled = $derived(pending);
- async function handleSubmit() {
+ async function handleSubmit(event) {
+ event.preventDefault();
pending = true;
const response = await createChannel(name);
if (200 <= response.status && response.status < 300) {
@@ -15,7 +16,7 @@
}
</script>
-<form on:submit|preventDefault={handleSubmit} class="form form-row flex-nowrap">
+<form onsubmit={handleSubmit} class="form form-row flex-nowrap">
<input
type="text"
placeholder="create channel"