X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=398a0a27d3ed8c9e0281203a5294013fa1b7e224;hb=12d38d0f53f4ab534e44467550b72705858810d4;hp=5145e5883461fc61e1c1a4ae949b635ef94dc5a9;hpb=1ef65040168ab7d55ce921abc9d63644a937d689;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 5145e588..398a0a27 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -490,7 +490,7 @@ export default { } }, getGameType: function(game) { - if (!!game.id.match(/^i/)) return "import"; + if (!!game.id.toString().match(/^i/)) return "import"; return game.cadence.indexOf("d") >= 0 ? "corr" : "live"; }, // Notify something after a new move (to opponent and me on MyGames page) @@ -1189,11 +1189,6 @@ export default { // - from server (one correspondance game I play[ed] or not) // - from remote peer (one live game I don't play, finished or not) fetchGame: function(callback) { - -console.log("fecth"); - console.log(this.gameRef); - console.log(this.gameRef.match(/^i/)); - if (Number.isInteger(this.gameRef) || !isNaN(parseInt(this.gameRef))) { // corr games identifiers are integers ajax( @@ -1456,9 +1451,12 @@ console.log("fecth"); } ); // PlayOnBoard is enough, and more appropriate for Synchrone Chess - V.PlayOnBoard(this.vr.board, move); + const arMove = (Array.isArray(move) ? move : [move]); + for (let i = 0; i < arMove.length; i++) + V.PlayOnBoard(this.vr.board, arMove[i]); const position = this.vr.getBaseFen(); - V.UndoOnBoard(this.vr.board, move); + for (let i = arMove.length - 1; i >= 0; i--) + V.UndoOnBoard(this.vr.board, arMove[i]); if (["all","byrow"].includes(V.ShowMoves)) { this.curDiag = getDiagram({ position: position,