changeset 647:620a65f11b33

fix: splitscreenoption has to be reset for logout
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 13 Sep 2018 14:11:33 +0200
parents 4450f2ab41e0
children cf62cb84fa23 83081ba6c9c1
files client/src/application/Userbar.vue client/src/application/stores/application.js
diffstat 2 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/application/Userbar.vue	Thu Sep 13 13:02:04 2018 +0200
+++ b/client/src/application/Userbar.vue	Thu Sep 13 14:11:33 2018 +0200
@@ -59,6 +59,7 @@
       this.$store.commit("user/clear_auth");
       this.$store.commit("application/resetSidebar");
       this.$store.commit("application/resetUserMenu");
+      this.$store.commit("application/resetSplitScreen");
       this.$router.push("/login");
     }
   },
--- a/client/src/application/stores/application.js	Thu Sep 13 13:02:04 2018 +0200
+++ b/client/src/application/stores/application.js	Thu Sep 13 14:11:33 2018 +0200
@@ -1,5 +1,12 @@
 const defaultCollapseState = true;
 
+const initializeSplitScreen = () => {
+  return {
+    active: false,
+    mode: "v"
+  };
+};
+
 const Application = {
   namespaced: true,
   state: {
@@ -8,10 +15,7 @@
     sidebar: {
       iscollapsed: defaultCollapseState
     },
-    splitsceen: {
-      active: false,
-      mode: "v"
-    },
+    splitsceen: initializeSplitScreen(),
     usermenu: {
       iscollapsed: defaultCollapseState
     },
@@ -61,6 +65,9 @@
     },
     collapseUserMenu: state => {
       state.usermenu.iscollapsed = true;
+    },
+    resetSplitScreen: state => {
+      state.splitsceen = initializeSplitScreen();
     }
   },
   actions: {}