X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=533bc0e2c1301e465518bda9b7adf3c71a4668c1;hb=4ecf423bce243e8e10b5b777a95f67ecc9f8d8d3;hp=63bf675c17659ad032d52a77a1049e5f7701de01;hpb=0b7d99ecbb5dedc02cd96c457b5fc2962db9b297;p=vchess.git diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index 63bf675c..533bc0e2 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -1083,7 +1083,10 @@ Vue.component('my-game', { const compMove = this.vr.getComputerMove(); // (first move) HACK: avoid selecting elements before they appear on page: const delay = Math.max(500-(Date.now()-timeStart), 0); - setTimeout(() => this.play(compMove, "animate"), delay); + setTimeout(() => { + if (this.mode == "computer") //Warning: mode could have changed! + this.play(compMove, "animate") + }, delay); }, // Get the identifier of a HTML table cell from its numeric coordinates o.x,o.y. getSquareId: function(o) {