trim whitespace before sending message

This commit is contained in:
hippoz 2023-08-09 20:31:08 +03:00
parent f4d499b5b8
commit b52a35a734
Signed by: hippoz
GPG key ID: 56C4E02A85F2FBED

View file

@ -98,9 +98,9 @@
const sendMessage = async () => { const sendMessage = async () => {
messageTextarea.focus(); messageTextarea.focus();
const content = messageInput; const content = messageInput.trim();
if (content.trim() === "" || !userInfoStore.value) if (!content.length || !userInfoStore.value)
return; return;
// optimistically add message to store // optimistically add message to store