X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=2beb10cb64c6f5b6193b21a3277ce42aa141a5f2;hb=b9ce3d0fbe6cf8cba01912706ad578144bc9b42f;hp=919a7ebca986bd7edd2dd87ed5a5ed713863539d;hpb=b4f2488a58c5c92e1673cd64c6bba13afcafbf66;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 919a7ebc..2beb10cb 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -753,6 +753,8 @@ export default { // Got opponent infos about last move this.gotLastate = true; this.lastate = data.data; + if (this.lastate.movesCount - 1 > this.gotMoveIdx) + this.gotMoveIdx = this.lastate.movesCount - 1; if (this.game.rendered) // Game is rendered (Board component) this.processLastate(); @@ -760,6 +762,12 @@ export default { break; } case "newmove": { + +// DEBUG: +console.log("Receive move"); +console.log(data.data); +//moveslist not updated when receiving a move? (see in baseGame) + const movePlus = data.data; const movesCount = this.game.moves.length; if (movePlus.index > movesCount) { @@ -1265,7 +1273,7 @@ export default { 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;