X-Git-Url: https://git.auder.net/images/diag_mark.svg?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=1e68fe63265860cf42bb61f7f7aad8994b4d2dd1;hb=cd3174c5a6c2a3f520cc8ff5974701996119dce3;hp=499e473ac1056faba02282decf9d88b2327dad78;hpb=4b5fe3061829e184f9ad86a13d831eda22d95343;p=vchess.git diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index 499e473a..1e68fe63 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -466,6 +466,13 @@ Vue.component('my-game', { this.score = "*"; if (mode=="human" && !oppId) { + const storageVariant = localStorage.getItem("variant"); + if (!!storageVariant && storageVariant !== variant) + { + // TODO: find a better way to ensure this. Newgame system is currently a mess. + alert("Finish your " + storageVariant + " game first!"); + return; + } // Send game request and wait.. this.clearStorage(); //in case of try { @@ -480,6 +487,7 @@ Vue.component('my-game', { } this.vr = new VariantRules(fen, moves || []); this.mode = mode; + this.incheck = []; //in case of this.fenStart = continuation ? localStorage.getItem("fenStart") : fen.split(" ")[0]; //Only the position matters