From: Benjamin Auder Date: Tue, 28 Jan 2020 11:00:49 +0000 (+0100) Subject: Fix. TODO: Vue reactivity on game.score and game. ... X-Git-Url: https://git.auder.net/assets/doc/DESCRIPTION?a=commitdiff_plain;h=697ee5803b6110b98de0e1097ce6affc712134c4;p=vchess.git Fix. TODO: Vue reactivity on game.score and game. ... --- diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index e880de5f..41ab55dc 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -100,6 +100,12 @@ export default { vr_tmp.play(move); move.fen = vr_tmp.getFen(); }); + if (this.game.fenStart.indexOf(" b ") >= 0 || + (this.moves.length > 0 && this.moves[0].color == "b")) + { + // 'end' is required for Board component to check lastMove for e.p. + this.moves.unshift({color: "w", notation: "...", end: {x:-1,y:-1}}); + } const L = this.moves.length; this.cursor = L-1; this.lastMove = (L > 0 ? this.moves[L-1] : null); diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index cebbff47..6e2ef66e 100644 --- a/client/src/components/MoveList.vue +++ b/client/src/components/MoveList.vue @@ -6,8 +6,6 @@ export default { render(h) { if (this.moves.length == 0) return; - if (this.moves[0].color == "b") - this.moves.unshift({color: "w", notation: "..."}); let tableContent = []; let moveCounter = 0; let tableRow = undefined; diff --git a/client/src/views/Analyze.vue b/client/src/views/Analyze.vue index d1b669ec..cd25c254 100644 --- a/client/src/views/Analyze.vue +++ b/client/src/views/Analyze.vue @@ -1,6 +1,8 @@