Improve 'connected' display in case of multi-accounts on same browser
authorBenjamin Auder <benjamin.auder@somewhere>
Fri, 6 Mar 2020 17:06:10 +0000 (18:06 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Fri, 6 Mar 2020 17:06:10 +0000 (18:06 +0100)
client/src/views/Game.vue

index 5c4630b..214f819 100644 (file)
@@ -232,8 +232,12 @@ export default {
     isConnected: function(index) {
       const player = this.game.players[index];
       // Is it me ?
-      if (this.st.user.sid == player.sid || this.st.user.id == player.uid)
+      if (
+        (this.st.user.sid == player.sid || this.st.user.id == player.uid) &&
+        (!this.st.user.name || this.st.user.name == player.name)
+      ) {
         return true;
+      }
       // Try to find a match in people:
       return (
         (