projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move 'anonymousCount' which was computed to a method in Hall. Seems more accurate
[vchess.git]
/
client
/
src
/
views
/
Hall.vue
diff --git
a/client/src/views/Hall.vue
b/client/src/views/Hall.vue
index
37558a9
..
8f86f4c
100644
(file)
--- a/
client/src/views/Hall.vue
+++ b/
client/src/views/Hall.vue
@@
-120,7
+120,7
@@
main
@click="challenge(sid)"
)
| {{ st.tr["Challenge"] }}
@click="challenge(sid)"
)
| {{ st.tr["Challenge"] }}
- p.anonymous @nonymous ({{ anonymousCount }})
+ p.anonymous @nonymous ({{ anonymousCount
()
}})
#chat
Chat(
:newChat="newChat"
#chat
Chat(
:newChat="newChat"
@@
-266,16
+266,6
@@
export default {
this.loadNewchallVariant();
}
},
this.loadNewchallVariant();
}
},
- computed: {
- anonymousCount: function() {
- let count = 0;
- Object.values(this.people).forEach(p => {
- // Do not cound people who did not send their identity yet:
- count += (!p.name && p.id === 0) ? 1 : 0;
- });
- return count;
- }
- },
created: function() {
if (this.st.variants.length > 0 && this.newchallenge.vid > 0)
this.loadNewchallVariant();
created: function() {
if (this.st.variants.length > 0 && this.newchallenge.vid > 0)
this.loadNewchallVariant();
@@
-436,6
+426,14
@@
export default {
["random-" + pc.randomness]: true
};
},
["random-" + pc.randomness]: true
};
},
+ anonymousCount: function() {
+ let count = 0;
+ Object.values(this.people).forEach(p => {
+ // Do not cound people who did not send their identity yet:
+ count += (!p.name && p.id === 0) ? 1 : 0;
+ });
+ return count;
+ },
visibilityChange: function() {
// TODO: Use document.hidden? https://webplatform.news/issues/2019-03-27
this.send(
visibilityChange: function() {
// TODO: Use document.hidden? https://webplatform.news/issues/2019-03-27
this.send(
@@
-854,8
+852,8
@@
export default {
cursor: this.cursor
},
success: (res) => {
cursor: this.cursor
},
success: (res) => {
- if (res.games.length > 0) {
- const L = res.games.length;
+ const L = res.games.length;
+ if (L > 0) {
this.cursor = res.games[L - 1].created;
let moreGames = res.games.map(g => {
const vname = this.getVname(g.vid);
this.cursor = res.games[L - 1].created;
let moreGames = res.games.map(g => {
const vname = this.getVname(g.vid);