void: fix "submission on reset" bug
diff --git a/apps/void/src/routes/+page.svelte b/apps/void/src/routes/+page.svelte
index ed7a2a9..d0b9f2c 100644
--- a/apps/void/src/routes/+page.svelte
+++ b/apps/void/src/routes/+page.svelte
@@ -46,9 +46,11 @@
<form
on:submit|preventDefault={() => {
- messages.push(currentlyTyped);
- messages = messages;
- currentlyTyped = '';
+ if (currentlyTyped) {
+ messages.push(currentlyTyped);
+ messages = messages;
+ currentlyTyped = '';
+ }
focusMessageInput();
}}
method="post"
@@ -78,6 +80,7 @@
currentlyTyped = '';
systemMessage = resetMessage;
messages = [];
+ focusMessageInput();
}}>Clean</Button
>
</div>