# HG changeset patch # User Markus Kottlaender # Date 1560762483 -7200 # Node ID 3eb19b38446e8ec0fa52734ffc5bf24519b6811e # Parent c91bcb92e0b78576a092d9fee6906e0117ae9150 client: avoid requesting number of pending imports after logging out diff -r c91bcb92e0b7 -r 3eb19b38446e client/src/components/Sidebar.vue --- 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); } };