From e9bab1c3e6bcefca0da68f6027af00795773c830 Mon Sep 17 00:00:00 2001
From: Quazgar <quazgar@posteo.de>
Date: Tue, 30 Jun 2020 12:02:08 +0000
Subject: [PATCH] FIX: Fixed problem where Tour's init() always reset the tour
 state.

---
 CHANGELOG.md        | 1 +
 src/core/js/tour.js | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 19d96209..d5c22505 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 * #101 - loading of A LOT of references in `ext_references` slows down the
   webui or even freezes the brower.
+* Fixed a bug where the Tour would lose its state upon page reload.
 
 ### Security (in case of vulnerabilities)
 
diff --git a/src/core/js/tour.js b/src/core/js/tour.js
index 57b42681..5d2c32aa 100644
--- a/src/core/js/tour.js
+++ b/src/core/js/tour.js
@@ -699,10 +699,11 @@ var tour = new function() {
     /**
      * Initialize the tour.
      */
-    this.init = async function _in(refresh=false) {
+    this.init = async function _in(refresh) {
         try {
-            tour.debug("initializing tour module");
-            if (refresh) {
+            tour.debug("initializing tour module, refresh: " + refresh);
+            if (refresh === true) {
+                tour.info("Refreshing tour state.");
                 localStorage.removeItem("tour_state");
             }
             await tour.load_tour();
-- 
GitLab