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

This commit is contained in:
Son NK 2020-02-05 14:33:00 +07:00
parent b40278f4dc
commit 6fe689dc17
2 changed files with 4 additions and 3 deletions

View file

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

View file

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