projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix online indicators between Hall and Game pages
[vchess.git]
/
client
/
src
/
views
/
Hall.vue
diff --git
a/client/src/views/Hall.vue
b/client/src/views/Hall.vue
index
e11e8e1
..
851201f
100644
(file)
--- 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
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)
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)
else
anonymous.count++;
});
if (anonymous.count > 0)
- playerList
.push(anonymous)
;
- return
playerList
;
+ playerList
[0] = anonymous
;
+ return
Object.values(playerList)
;
},
},
created: function() {
},
},
created: function() {