diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/MessagesList/MessagesGroup/Message/MessagePart/Poll.vue | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/Poll.vue b/src/components/MessagesList/MessagesGroup/Message/MessagePart/Poll.vue index fee80ad1b..c133eb383 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/Poll.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/Poll.vue @@ -130,11 +130,10 @@ {{ getVotePercentage(index) + '%' }} </p> </div> - <div class="results__option__details"> + <div v-if="getFilteredDetails(index).length > 0 || selfHasVotedOption(index)" + class="results__option__details"> <PollVotersDetails v-if="details" - :details="details.filter((item) => { - return item.optionId === index - }).slice(0, 8)" /> + :details="getFilteredDetails(index)" /> <p v-if="selfHasVotedOption(index)" class="results__option-subtitle"> {{ t('spreed','You voted') }} </p> @@ -443,6 +442,15 @@ export default { return false } }, + + getFilteredDetails(index) { + if (!this.details) { + return [] + } + return this.details.filter((item) => { + return item.optionId === index + }).slice(0, 8) + }, }, } </script> |