From 8bd5e69cb454e7315e4b8b3e20f415587356366e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Gieling?= Date: Tue, 2 Mar 2021 14:41:39 +0100 Subject: added hide options if booked out and move some logic to backend (#1449) --- src/js/mixins/watchPolls.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/js/mixins/watchPolls.js') 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 -- cgit v1.2.3