summaryrefslogtreecommitdiff
path: root/ui/lib/components/CreateChannelForm.svelte
diff options
context:
space:
mode:
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"