Fix Horde variant + a bug when socket is not ready in Hall and Game send() method
[vchess.git] / client / src / views / Hall.vue
index 57557d4..ab5108e 100644 (file)
@@ -502,7 +502,7 @@ export default {
         document.getElementById("cadence").focus();
     },
     send: function(code, obj) {
-      if (!!this.conn) {
+      if (!!this.conn && this.conn.readyState == 1) {
         this.conn.send(JSON.stringify(Object.assign({ code: code }, obj)));
       }
     },