Suggest using Redis when failing to deliver messages
[vchess.git] / public / javascripts / components / game.js
index 499e473..1e68fe6 100644 (file)
@@ -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