This commit is contained in:
Родитель
be36c90515
Коммит
5518cfd715
|
@ -128,6 +128,7 @@ export default {
|
|||
|
||||
data() {
|
||||
return {
|
||||
reloadInterval: 30000,
|
||||
voteSaved: false,
|
||||
delay: 50,
|
||||
isLoading: true,
|
||||
|
@ -268,10 +269,12 @@ export default {
|
|||
this.loadPoll()
|
||||
emit('toggle-sidebar', { open: (window.innerWidth > 920) })
|
||||
}
|
||||
this.timedReload()
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.$store.dispatch({ type: 'poll/reset' })
|
||||
window.clearInterval(this.reloadTimer)
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
@ -279,6 +282,13 @@ export default {
|
|||
emit('toggle-sidebar', { open: true, activeTab: 'options' })
|
||||
},
|
||||
|
||||
timedReload() {
|
||||
// reload poll list periodically
|
||||
this.reloadTimer = window.setInterval(() => {
|
||||
this.$store.dispatch({ type: 'poll/get', pollId: this.$route.params.id, token: this.$route.params.token })
|
||||
}, this.reloadInterval)
|
||||
},
|
||||
|
||||
getNextViewMode() {
|
||||
if (this.settings.viewModes.indexOf(this.viewMode) < 0) {
|
||||
return this.settings.viewModes[1]
|
||||
|
|
Загрузка…
Ссылка в новой задаче