changeset 2383:8d025f85a3fe

client: made indicator for open imports show up immediatly The indicator in the main menu button relies on the staged imports to be loaded, which formerly only happended when opening the respective staging area box. Now they are loaded in the mounted hook of the sidebar component. Maybe this kind of calls should be made in a more central place.
author Markus Kottlaender <markus@intevation.de>
date Mon, 25 Feb 2019 08:47:59 +0100
parents c28971cd70ce
children c06b001dc26b
files client/src/components/Sidebar.vue
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Sidebar.vue	Mon Feb 25 08:35:47 2019 +0100
+++ b/client/src/components/Sidebar.vue	Mon Feb 25 08:47:59 2019 +0100
@@ -167,6 +167,7 @@
  */
 import { mapGetters, mapState } from "vuex";
 import { logOff } from "@/lib/session.js";
+import { displayError } from "@/lib/errors";
 
 export default {
   name: "sidebar",
@@ -209,6 +210,15 @@
         this.routeName == "mainview"
       );
     }
+  },
+  mounted() {
+    this.$store.dispatch("imports/getStaging").catch(error => {
+      const { status, data } = error.response;
+      displayError({
+        title: "Backend Error",
+        message: `${status}: ${data.message || data}`
+      });
+    });
   }
 };
 </script>