X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=a17876da697e6014dc0c6dbfb1d6d37e997dc0da;hb=77fa6d1fe6306f1f9dcd3c363bba8965b602d237;hp=91e13e455f384f773861b31503f4dee50436cfcc;hpb=5e27be422b4d93d8db080c74570dddf3548ee93e;p=vchess.git diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index 91e13e45..a17876da 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -1167,7 +1167,6 @@ Vue.component('my-game', { setTimeout(() => { modalBox.checked = false; }, 2000); }, endGame: function(score) { - console.log("call " + score + " " + this.mode); this.score = score; if (["human","computer"].includes(this.mode)) { @@ -1317,7 +1316,8 @@ Vue.component('my-game', { const storageVariant = localStorage.getItem("comp-variant"); if (!!storageVariant) { - if (storageVariant !== variant) + const score = localStorage.getItem("comp-score"); + if (storageVariant !== variant && score == "*") { if (!confirm("Unfinished " + storageVariant + " computer game will be erased")) @@ -1325,12 +1325,8 @@ Vue.component('my-game', { return; } } - else - { - const score = localStorage.getItem("comp-score"); - if (score == "*") - return this.continueGame("computer"); - } + else if (score == "*") + return this.continueGame("computer"); } } this.vr = new VariantRules(fen, []);