changeset 553:f41c74b8af9c

fix: Sidebar/Topmenu only visible when logged in Commit 89bc8111563a dealt with restructuring the components, making the Sidebar and the topmenu part of the App-main view. While those menus were rendered as part of the router view, they were only visible, when the according view was called; they were now visible without even login. This is now fixed.
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 03 Sep 2018 09:57:29 +0200
parents ac61b03c0eaf
children fa4f623e3ca6
files client/src/App.vue
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/App.vue	Fri Aug 31 16:31:34 2018 +0200
+++ b/client/src/App.vue	Mon Sep 03 09:57:29 2018 +0200
@@ -1,7 +1,7 @@
 <template>
   <div id="app main d-flex flex-column">
-    <Topbar></Topbar>
-    <Sidebar></Sidebar>
+    <Topbar v-if="isAuthenticated"></Topbar>
+    <Sidebar v-if="isAuthenticated"></Sidebar>
     <router-view/>
   </div>
 </template>
@@ -32,8 +32,13 @@
 <script>
 import Sidebar from "./components/Sidebar";
 import Topbar from "./components/Topbar";
+import { mapGetters } from "vuex";
+
 export default {
   name: "app",
+  computed: {
+    ...mapGetters("user", ["isAuthenticated"])
+  },
   components: {
     Sidebar,
     Topbar