X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=91e6b6affd0a2eaf9076622aaed0657c7ac75b76;hp=8e03a861899ecdbec3b260aa1679fdbdf54460ef;hb=e8da204a3064d6cc3d655e94413e7cdb85e381c7;hpb=9ee2826a272b763b2d43980e2a638c045c4f6dba diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 8e03a861..91e6b6af 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -387,7 +387,20 @@ export default { } break; case "askfullgame": - this.send("fullgame", { data: this.game, target: data.from }); + const gameToSend = Object.keys(this.game) + .filter(k => + [ + "id","fen","players","vid","cadence","fenStart","vname", + "moves","clocks","initime","score","drawOffer" + ].includes(k)) + .reduce( + (obj, k) => { + obj[k] = this.game[k]; + return obj; + }, + {} + ); + this.send("fullgame", { data: gameToSend, target: data.from }); break; case "fullgame": // Callback "roomInit" to poll clients only after game is loaded @@ -641,7 +654,7 @@ export default { } } } - if (game.drawOffer) { + if (!!game.drawOffer) { if (game.drawOffer == "t") // Three repetitions this.drawOffer = "threerep";