changeset 3680:0300282b9537

client: configuration: changed loading strategy Only load configuration values from backend when entering the main/map view or systemconfiguration page
author Markus Kottlaender <markus@intevation.de>
date Tue, 18 Jun 2019 12:02:18 +0200
parents 0227670dedd5
children c9e1848a516a
files client/src/components/Login.vue client/src/components/systemconfiguration/Systemconfiguration.vue client/src/router.js
diffstat 3 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Login.vue	Mon Jun 17 18:45:48 2019 +0200
+++ b/client/src/components/Login.vue	Tue Jun 18 12:02:18 2019 +0200
@@ -193,10 +193,8 @@
         .dispatch("user/login", { user, password })
         .then(() => {
           this.loginFailed = false;
-          this.$store.dispatch("application/loadConfig").then(() => {
-            this.$router.push(localStorage.getItem("tempRoute") || "/");
-            localStorage.removeItem("tempRoute");
-          });
+          this.$router.push(localStorage.getItem("tempRoute") || "/");
+          localStorage.removeItem("tempRoute");
         })
         .catch(error => {
           this.loginFailed = true;
--- a/client/src/components/systemconfiguration/Systemconfiguration.vue	Mon Jun 17 18:45:48 2019 +0200
+++ b/client/src/components/systemconfiguration/Systemconfiguration.vue	Tue Jun 18 12:02:18 2019 +0200
@@ -48,6 +48,9 @@
     systemconfigurationLabel() {
       return this.$gettext("Systemconfiguration");
     }
+  },
+  mounted() {
+    this.$store.dispatch("application/loadConfig");
   }
 };
 </script>
--- a/client/src/router.js	Mon Jun 17 18:45:48 2019 +0200
+++ b/client/src/router.js	Tue Jun 18 12:02:18 2019 +0200
@@ -92,7 +92,7 @@
         store.commit("application/showContextBox", false);
         store.commit("application/contextBoxContent", "");
         store.commit("application/showSearchbar", false);
-        next();
+        store.dispatch("application/loadConfig").then(() => next());
       }
     },
     {
@@ -213,7 +213,6 @@
     store.commit("user/setExpires", expiresFromPastSession);
     store.commit("user/setRoles", localStorage.getItem("roles"));
     store.commit("user/setIsAuthenticate", true);
-    store.dispatch("application/loadConfig");
   } else {
     store.commit("reset");
     store.commit("user/clearAuth");