X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=851201f8590d6db9f5e33f1fda52ccca0d8ab7ae;hp=e11e8e1377a680f1212d1b9ae59a2a70d2dda06e;hb=bcaa8c0061b67fa95691a951d415bafef33265a2;hpb=80ee5d5a70f17f78900a8a3ae2d803ed1f2f14c9 diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index e11e8e13..851201f8 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -117,17 +117,21 @@ export default { computed: { uniquePlayers: function() { // Show e.g. "@nonymous (5)", and do nothing on click on anonymous - let anonymous = {id:0, name:"@nonymous", count:0}; - let playerList = []; + let anonymous = {name:"@nonymous", count:0}; + let playerList = {}; this.people.forEach(p => { if (p.id > 0) - playerList.push(p); + { + // We don't count registered users connections: either they are here or not. + if (!playerList[p.id]) + playerList[p.id] = {name: p.name, count: 0}; + } else anonymous.count++; }); if (anonymous.count > 0) - playerList.push(anonymous); - return playerList; + playerList[0] = anonymous; + return Object.values(playerList); }, }, created: function() {