X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=09d9df8a3255a47cda09afb04f97c82cbbe89e4f;hp=984a66bff76c7fd8ecc65e92a2205fefe82847ae;hb=ab6f48ea4d9c549830f549f077c597f57ea4a57d;hpb=dc284d90d4f9228fc99e0b39394cbfded23657e5 diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 984a66bf..09d9df8a 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -189,7 +189,7 @@ export default { { // Minimal game informations: id: this.game.id, - players: this.game.players.map(p => p.name), + players: this.game.players.map(p => { return {name:p.name}; }), vid: this.game.vid, timeControl: this.game.timeControl, }; @@ -512,7 +512,11 @@ export default { gameOver: function(score) { this.game.mode = "analyze"; this.game.score = score; - GameStorage.update(this.gameRef.id, { score: score }); + const myIdx = this.game.players.findIndex(p => { + return p.sid == this.st.user.sid || p.uid == this.st.user.id; + }); + if (myIdx >= 0) //OK, I play in this game + GameStorage.update(this.gameRef.id, { score: score }); }, }, };