diff options
author | René Gieling <github@dartcafe.de> | 2021-03-02 16:41:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-02 16:41:39 +0300 |
commit | 8bd5e69cb454e7315e4b8b3e20f415587356366e (patch) | |
tree | 445444dab8425aa8427bc4e6cf675ea241721351 /src/js/mixins/watchPolls.js | |
parent | 5e04fe191f047d88080db44c60b0b562d7b1f62a (diff) |
added hide options if booked out and move some logic to backend (#1449)
Diffstat (limited to 'src/js/mixins/watchPolls.js')
-rw-r--r-- | src/js/mixins/watchPolls.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/js/mixins/watchPolls.js b/src/js/mixins/watchPolls.js index aea224ca..b34d683c 100644 --- a/src/js/mixins/watchPolls.js +++ b/src/js/mixins/watchPolls.js @@ -47,10 +47,16 @@ export const watchPolls = { // load poll list only, when not in public poll dispatches.push('polls/load') } - if (item.pollId === parseInt(this.$route.params.id)) { + if (item.pollId === parseInt(this.$route.params.id ?? this.$store.state.share.pollId)) { // if current poll is affected, load current poll configuration dispatches.push('poll/get') + // load also options and votes + dispatches.push('votes/list') + dispatches.push('options/list') } + } else if (['votes', 'options'].includes(item.table)) { + dispatches.push('votes/list') + dispatches.push('options/list') } else { // a table of the current poll was reported, load // corresponding stores |