diff options
author | Marco Ambrosini <marcoambrosini@icloud.com> | 2022-08-26 16:30:04 +0200 |
---|---|---|
committer | Marco Ambrosini <marcoambrosini@icloud.com> | 2022-08-26 16:30:04 +0200 |
commit | 0571fdfd9d22c6d6ef4cd68ef127906b39e74890 (patch) | |
tree | 3b03b0a8a7065dd722203ba47b19ae93c060fa3f /src | |
parent | 8f45fd68a115df4d9ff6f7edb2f814ddc2e55c43 (diff) |
Immediately update poll if closed
Signed-off-by: Marco Ambrosini <marcoambrosini@icloud.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/MessagesList/MessagesGroup/Message/MessagePart/Poll.vue | 2 | ||||
-rw-r--r-- | src/store/messagesStore.js | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/Poll.vue b/src/components/MessagesList/MessagesGroup/Message/MessagePart/Poll.vue index 27fbb86c2..489f0d882 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/Poll.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/Poll.vue @@ -375,7 +375,7 @@ export default { }, openPoll() { - if (this.selfHasVoted) { + if (this.selfHasVoted || this.pollIsClosed) { this.modalPage = 'results' } else { this.modalPage = 'voting' diff --git a/src/store/messagesStore.js b/src/store/messagesStore.js index bc72557b3..b19b00545 100644 --- a/src/store/messagesStore.js +++ b/src/store/messagesStore.js @@ -422,6 +422,13 @@ const actions = { }) } + if (message.systemMessage === 'poll_closed') { + context.dispatch('getPollData', { + token: message.token, + pollId: message.messageParameters.poll.id, + }) + } + context.commit('addMessage', message) if ((message.messageType === 'comment' && message.message === '{file}' && message.messageParameters?.file) |