X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=2beb10cb64c6f5b6193b21a3277ce42aa141a5f2;hp=62611393b0b961dccf434ddd6a7e9ffe7809794b;hb=b9ce3d0fbe6cf8cba01912706ad578144bc9b42f;hpb=8948a2876de183467f610a703d8c7f6d7c2df570 diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 62611393..2beb10cb 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -753,8 +753,8 @@ export default { // Got opponent infos about last move this.gotLastate = true; this.lastate = data.data; - if (this.lastate.movesCount > this.gotMoveIdx) - this.gotMoveIdx = this.lastate.movesCount; + if (this.lastate.movesCount - 1 > this.gotMoveIdx) + this.gotMoveIdx = this.lastate.movesCount - 1; if (this.game.rendered) // Game is rendered (Board component) this.processLastate(); @@ -1273,7 +1273,7 @@ console.log(data.data); this.$nextTick(() => { this.game.rendered = true; // Did lastate arrive before game was rendered? - if (this.lastate) this.processLastate(); + if (!!this.lastate) this.processLastate(); }); if (this.lastateAsked) { this.lastateAsked = false;