summaryrefslogtreecommitdiff
path: root/ui/lib/components/MessageInput.svelte
diff options
context:
space:
mode:
authorKit La Touche <kit@transneptune.net>2024-10-30 23:26:23 -0400
committerKit La Touche <kit@transneptune.net>2024-10-30 23:26:23 -0400
commit80220d2188e0553304f2c78d225bbe275d8ba572 (patch)
treede0a62325c698197612574c7a9f37dad279581be /ui/lib/components/MessageInput.svelte
parent51aabd07ca5eeaee45a564f8799cc42dc195068c (diff)
parent35b8a914b867237c9c64f33838b1e1f85fc46fb8 (diff)
Merge branch 'main' into wip/mobile
Diffstat (limited to 'ui/lib/components/MessageInput.svelte')
-rw-r--r--ui/lib/components/MessageInput.svelte10
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/lib/components/MessageInput.svelte b/ui/lib/components/MessageInput.svelte
index b2746e0..03ac7fa 100644
--- a/ui/lib/components/MessageInput.svelte
+++ b/ui/lib/components/MessageInput.svelte
@@ -5,16 +5,16 @@
export let channel = null;
let input;
let value = '';
- let sending = false;
+ let pending = false;
- $: disabled = (channel === null);
+ $: disabled = pending || (channel === null);
async function handleSubmit() {
if (channel !== null) {
- sending = true;
+ pending = true;
// TODO try/catch:
await postToChannel(channel, value);
- sending = false;
+ pending = false;
value = '';
await tick();
input.focus();
@@ -23,6 +23,6 @@
</script>
<form on:submit|preventDefault={handleSubmit} class="flex flex-row flex-nowrap">
- <input bind:this={input} bind:value={value} disabled={sending || disabled} type="search" class="flex-auto h-6 input rounded-r-none" />
+ <input bind:this={input} bind:value={value} disabled={disabled} type="search" class="flex-auto h-6 input rounded-r-none" />
<button color="primary variant-filled-secondary" type="submit" class="flex-none w-6 h-6 btn-icon variant-filled rounded-l-none">&raquo;</button>
</form>