Add polling for getOverview in toolbar

This commit is contained in:
Lukas Haß 2020-04-27 17:48:05 +02:00 committed by GitHub
parent 2ce2d63bda
commit 2f18e20cb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,9 @@ export default {
name: 'ToolBar', name: 'ToolBar',
data () { data () {
return { return {
loadingOverview: true loadingOverview: true,
intervalRefresh: null,
intervalRefreshTime: 5000
} }
}, },
computed: { computed: {
@ -65,8 +67,10 @@ export default {
}, },
created () { created () {
this.refreshAll() this.refreshAll()
this.intervalRefresh = setInterval(this.onGetAll, this.intervalRefreshTime)
}, },
beforeDestroy () { beforeDestroy () {
clearInterval(this.intervalRefresh)
this.$store.commit('core/getOverviewClear') this.$store.commit('core/getOverviewClear')
} }
} }