Mercurial > gemma
diff client/src/components/Sidebar.vue @ 3668:3eb19b38446e
client: avoid requesting number of pending imports after logging out
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Mon, 17 Jun 2019 11:08:03 +0200 |
parents | d02d4e31491b |
children | 008bc1ae8897 |
line wrap: on
line diff
--- a/client/src/components/Sidebar.vue Mon Jun 17 11:00:21 2019 +0200 +++ b/client/src/components/Sidebar.vue Mon Jun 17 11:08:03 2019 +0200 @@ -103,6 +103,11 @@ export default { name: "sidebar", + data() { + return { + notificationTimer: null + }; + }, computed: { ...mapGetters("user", ["isSysAdmin", "isWaterwayAdmin"]), ...mapState("user", ["user", "roles", "isAuthenticated"]), @@ -149,7 +154,7 @@ .dispatch("imports/loadStagingNotifications") .then(() => { if (this.isAuthenticated) { - setTimeout(updateIndicators, 15000); + this.notificationTimer = setTimeout(updateIndicators, 15000); } }) .catch(error => { @@ -161,7 +166,10 @@ }); } }; - setTimeout(updateIndicators, 15000); + updateIndicators(); + }, + destroyed() { + clearTimeout(this.notificationTimer); } }; </script>