check if content isn't just whitespaces (client side this time)
Signed-off-by: carsand101 <carsand101@noreply.codeberg.org>
This commit is contained in:
parent
232798fa17
commit
38e2c74f47
|
@ -72,9 +72,14 @@ async function sendMessage(content, id) {
|
||||||
|
|
||||||
messageBox.addEventListener("keyup", function onEvent(event) {
|
messageBox.addEventListener("keyup", function onEvent(event) {
|
||||||
if (event.key === "Enter") {
|
if (event.key === "Enter") {
|
||||||
sendMessage(messageBox.value, channelID)
|
if (!messageBox.value.trim().length == 0) {
|
||||||
updateMessages(channelID)
|
sendMessage(messageBox.value, channelID)
|
||||||
messageBox.value = ""
|
updateMessages(channelID)
|
||||||
|
messageBox.value = ""
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Reference in New Issue