Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2020-12-20 00:24:24 +0300
committerdartcafe <github@dartcafe.de>2020-12-20 00:24:24 +0300
commit5518cfd715975cbce1fa6c58f15cd447f411d521 (patch)
treed02b9b07569f95db42a955a6b2403d4f43e73e4a /src/js/views/Vote.vue
parentbe36c90515bbd0be0f9d5decfa1fad7d0ce0c3fa (diff)
fix #907
Diffstat (limited to 'src/js/views/Vote.vue')
-rw-r--r--src/js/views/Vote.vue10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/js/views/Vote.vue b/src/js/views/Vote.vue
index cd61ffc8..adf4ad17 100644
--- a/src/js/views/Vote.vue
+++ b/src/js/views/Vote.vue
@@ -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]