Browse Source

use store instead of localStorage to detect whether the intro has been shown

Son NK 5 years ago
parent
commit
6fe689dc17
2 changed files with 4 additions and 3 deletions
  1. 2 2
      app/dashboard/templates/dashboard/index.html
  2. 2 1
      templates/base.html

+ 2 - 2
app/dashboard/templates/dashboard/index.html

@@ -273,12 +273,12 @@
   <script>
     var clipboard = new ClipboardJS('.clipboard');
 
-    var introShown = localStorage.getItem("introShown");
+    var introShown = store.get("introShown");
     if ("yes" !== introShown) {
       // only show intro when screen is big enough to show "developer" tab
       if (window.innerWidth >= 1024) {
         introJs().start();
-        localStorage.setItem("introShown", "yes")
+        store.set("introShown", "yes")
       }
     }
 

+ 2 - 1
templates/base.html

@@ -170,11 +170,12 @@
 
 </script>
 
+<script src="/static/local-storage-polyfill.js"></script>
+
 <!-- For additional script -->
 {% block script %}
 {% endblock %}
 
-<script src="/static/local-storage-polyfill.js"></script>
 <script>
   (function () {
     // only enable on prod