X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=2df03e6ec2bf4bce6895cac7fb7a151e638d8636;hp=7b42854d26d7e5d458cbd90948c6d5e38bf4ad58;hb=41c80bb63b85b2696d3925c10784c3d7bb5d2aa3;hpb=dcd68c4108412f45b8ce119ae80ce8f6e296800b diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 7b42854d..2df03e6e 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -49,10 +49,11 @@ main button(@click="pdisplay='players'") Players button(@click="pdisplay='chat'") Chat #players(v-show="pdisplay=='players'") - p.text-center(v-for="p in uniquePlayers") + p(v-for="p in uniquePlayers") span(:class="{anonymous: !!p.count}") | {{ (p.name || '@nonymous') + (!!p.count ? " ("+p.count+")" : "") }} - button.player-action(v-if="!p.count" @click="challOrWatch(p,$event)") + button.player-action(v-if="!p.count && p.name != st.user.name" + @click="challOrWatch(p,$event)") | {{ whatPlayerDoes(p) }} #chat(v-show="pdisplay=='chat'") Chat(:players="[]") @@ -233,8 +234,11 @@ export default { return (!!variant ? variant.name : ""); }, whatPlayerDoes: function(p) { - if (this.games.some(g => g.players.some(pl => pl.sid == p.sid))) + if (this.games.some(g => g.type == "live" + && g.players.some(pl => pl.sid == p.sid))) + { return "Playing"; + } return "Challenge"; //player is available }, sendSomethingTo: function(to, code, obj, warnDisconnected) { @@ -428,7 +432,7 @@ export default { case "Playing": // NOTE: this search for game was already done for rendering this.showGame(this.games.find( - g => g.players.some(pl => pl.sid == p.sid))); + g => g.type=="live" && g.players.some(pl => pl.sid == p.sid))); break; }; }, @@ -620,7 +624,7 @@ export default { }; -