# HG changeset patch # User Markus Kottlaender # Date 1551682013 -3600 # Node ID 374ee552ca85b4ac3b16c9c4a4ebbb315f47be06 # Parent 194b42f28ea305d7f7f83bd2af42c92ccc21efd0 client: immediately load data for menu indicator I always forget that setInterval runs for first time _after_ the interval past, not immediately. So now the code is executed on mount and then in a 15s inteval. diff -r 194b42f28ea3 -r 374ee552ca85 client/src/components/Sidebar.vue --- a/client/src/components/Sidebar.vue Mon Mar 04 07:38:34 2019 +0100 +++ b/client/src/components/Sidebar.vue Mon Mar 04 07:46:53 2019 +0100 @@ -199,10 +199,8 @@ this.contextBoxContent === item && this.routeName == "mainview" ); - } - }, - mounted() { - setTimeout(() => { + }, + updateIndicators() { this.$store.dispatch("imports/getStaging").catch(error => { const { status, data } = error.response; displayError({ @@ -210,7 +208,11 @@ message: `${status}: ${data.message || data}` }); }); - }, 15000); + } + }, + mounted() { + this.updateIndicators(); + setTimeout(this.updateIndicators, 15000); } };