X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=51e06340a1e98f8306990fdf9c645cbd4f509964;hb=1c5bfdf23707e893735f185786e9774b2270ace1;hp=1294d50db85ac338b6b78bec30af326e686618c5;hpb=725da57f8e2983d744629b524f9084516a43cbac;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 1294d50d..51e06340 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -463,13 +463,15 @@ export default { game.chats.sort((c1, c2) => { return c2.added - c1.added; }); - if (myIdx >= 0 && game.chats.length > 0) { + if (myIdx >= 0 && game.score == "*" && game.chats.length > 0) { // Did a chat message arrive after my last move? let vr_tmp = new V(game.fen); //start from last position const flags = V.ParseFen(game.fen).flags; //may be undefined let dtLastMove = 0; for (let midx = game.moves.length - 1; midx >= 0; midx--) { - vr_tmp.undo(Object.assign({flags:flags}, game.moves[midx].squares)); + // NOTE: flags could be wrong, but since our only concern is turn, + // this should be enough. (TODO?) + vr_tmp.undo(Object.assign({flags:JSON.stringify(flags)}, game.moves[midx].squares)); if (vr_tmp.turn == mycolor) { dtLastMove = game.moves[midx].played; break; @@ -599,7 +601,7 @@ export default { if (countdown < 0) this.gameOver( currentTurn == "w" ? "0-1" : "1-0", - this.st.tr["Time"] + "Time" ); } else this.$set(