summaryrefslogtreecommitdiff
path: root/ui/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ui/lib')
-rw-r--r--ui/lib/components/CreateChannelForm.svelte7
-rw-r--r--ui/lib/components/Message.svelte2
-rw-r--r--ui/lib/components/MessageInput.svelte8
3 files changed, 7 insertions, 10 deletions
diff --git a/ui/lib/components/CreateChannelForm.svelte b/ui/lib/components/CreateChannelForm.svelte
index afa3f78..d50e60d 100644
--- a/ui/lib/components/CreateChannelForm.svelte
+++ b/ui/lib/components/CreateChannelForm.svelte
@@ -2,17 +2,16 @@
import { createChannel } from '$lib/apiServer';
let name = $state('');
- let pending = false;
- let disabled = $derived(pending);
+ let disabled = $state(false);
async function handleSubmit(event) {
event.preventDefault();
- pending = true;
+ disabled = true;
const response = await createChannel(name);
if (200 <= response.status && response.status < 300) {
name = '';
}
- pending = false;
+ disabled = false;
}
</script>
diff --git a/ui/lib/components/Message.svelte b/ui/lib/components/Message.svelte
index fddeecd..1663696 100644
--- a/ui/lib/components/Message.svelte
+++ b/ui/lib/components/Message.svelte
@@ -23,7 +23,7 @@
}
</script>
-<div class="message relative" class:bg-warning-800={deleteArmed} {onmouseleave}>
+<div class="message relative" class:bg-warning-800={deleteArmed} {onmouseleave} role="article">
<div class="handle chip bg-surface-700 absolute -top-6 right-0">
{at}
{#if editable}
diff --git a/ui/lib/components/MessageInput.svelte b/ui/lib/components/MessageInput.svelte
index 26521e1..22456f3 100644
--- a/ui/lib/components/MessageInput.svelte
+++ b/ui/lib/components/MessageInput.svelte
@@ -5,16 +5,14 @@
let form;
let value = $state('');
- let pending = false;
-
- let disabled = $derived(pending);
+ let disabled = $state(false);
async function onSubmit(event) {
event.preventDefault();
- pending = true;
+ disabled = true;
await postToChannel(channel, value);
form.reset();
- pending = false;
+ disabled = false;
}
function onKeyDown(event) {