Fix attempt - still chat issues when tabs are not reloaded after live game start
[vchess.git] / client / src / components / Chat.vue
index b4970f7..2dc6842 100644 (file)
@@ -23,12 +23,14 @@ export default {
     };
   },
   created: function() {
+    const curMsgListener = this.st.conn.onmessage; //from Game or Hall
     const socketMessageListener = msg => {
+      curMsgListener(msg);
       const data = JSON.parse(msg.data);
       if (data.code == "newchat") //only event at this level
       {
         this.chats.push({msg:data.msg,
-          name:data.name || "@nonymous", sid:data.sid});
+          name:data.name || "@nonymous", sid:data.from});
       }
     };
     const socketCloseListener = () => {