From: Benjamin Auder Date: Wed, 5 Jun 2019 09:56:03 +0000 (+0200) Subject: TODO: GameStorage.update + clocks started... X-Git-Url: https://git.auder.net/variants/current/doc/css/pieces/%7B%7B%20targetUrl%20%7D%7D?a=commitdiff_plain;h=b4fb161253c5e7b4581ca37d22339111dd4aa861;p=vchess.git TODO: GameStorage.update + clocks started... --- diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index e8ca6967..5ee5e0c7 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -145,7 +145,7 @@ export default { endGame: function(score) { this.score = score; this.showScoreMsg(score); - this.$emit("gameover"); //score not required (TODO?) + this.$emit("gameover", score); }, animateMove: function(move) { let startSquare = document.getElementById(getSquareId(move.start)); diff --git a/client/src/utils/storage.js b/client/src/utils/storage.js index 48435b51..8a7c5268 100644 --- a/client/src/utils/storage.js +++ b/client/src/utils/storage.js @@ -110,12 +110,12 @@ export const GameStorage = // localStorage: // TODO: also option to takeback a move ? Is fen included in move ? // NOTE: for live games only (all on server for corr) - update: function(fen, moves, clocks, started, score) + update: function(fen, move, clocks, started, score) { let gameState = JSON.parse(localStorage.getItem("gameState")); if (!!fen) { - gameState.moves = moves; + gameState.moves.push(move); gameState.fen = fen; gameState.clocks = clocks; } diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index dd04b869..13dc4865 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -16,7 +16,8 @@ pareil quand quelqu'un reco.