Some fixes
[vchess.git] / client / src / components / Chat.vue
index d8513b3..65e0dcb 100644 (file)
@@ -51,7 +51,9 @@ export default {
     },
     sendChat: function() {
       let chatInput = document.getElementById("inputChat");
-      const chatTxt = chatInput.value;
+      const chatTxt = chatInput.value.trim();
+      if (chatTxt == "")
+        return; //nothing to send
       chatInput.value = "";
       const chat = {msg:chatTxt, name: this.st.user.name || "@nonymous"};
       this.$emit("newchat-sent", chat); //useful for corr games