Mark rules as read also when visiting /variants/Somevariant page
authorBenjamin Auder <benjamin.auder@somewhere>
Thu, 30 Apr 2020 23:34:26 +0000 (01:34 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Thu, 30 Apr 2020 23:34:26 +0000 (01:34 +0200)
client/src/views/Rules.vue

index d96f1ed..09fe2e1 100644 (file)
@@ -99,6 +99,10 @@ export default {
       else if (this.gameInProgress) this.display = "computer";
     },
     re_setVariant: async function(vname) {
+      const key = "rr_" + vname;
+      if (!localStorage.getItem(key))
+        // Mark rules as "read"
+        localStorage.setItem(key, '1');
       await import("@/variants/" + vname + ".js")
       .then((vModule) => {
         this.V = window.V = vModule[vname + "Rules"];