X-Git-Url: https://git.auder.net/images/pieces/%22%20%20VariantRules.getPpath%28board%5Bi%5D%5Bj%5D%29%20%20%20%22.svg?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=bd66f7310af01bd864487c55af260a9f74fb2d83;hb=da2f044481b0eb4d041569149a457365940743aa;hp=96833bc087130bc138690a86d9102314d55c2e2e;hpb=0869b00a0e716a559c7a70ba2d854eed91689e33;p=vchess.git diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index 96833bc0..bd66f731 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -493,10 +493,12 @@ Vue.component('my-game', { this.score = score; let modalBox = document.getElementById("modal-eog"); modalBox.checked = true; - setTimeout(() => { modalBox.checked = false; }, 2000); + setTimeout(() => { + modalBox.checked = false; + this.mode = "idle"; //TODO: not the best way... (to see correct opponent in PGN) + }, 2000); if (this.mode == "human") this.clearStorage(); - this.mode = "idle"; this.oppid = ""; }, getEndgameMessage: function(score) { @@ -616,7 +618,6 @@ Vue.component('my-game', { this.oppConnected = true; this.mycolor = color; this.seek = false; - this.mode = "human"; if (!!moves && moves.length > 0) //imply continuation { const lastMove = moves[moves.length-1]; @@ -629,7 +630,6 @@ Vue.component('my-game', { } else //against computer { - this.mode = "computer"; this.mycolor = Math.random() < 0.5 ? 'w' : 'b'; if (this.mycolor == 'b') setTimeout(this.playComputerMove, 500);