DEV: Add poll:voted event (#12070)

This commit is contained in:
Penar Musaraj 2021-02-12 13:06:27 -05:00 committed by GitHub
parent 46e7d303b1
commit 5d8673321f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -962,6 +962,8 @@ export default createWidget("discourse-poll", {
})
.then(({ poll }) => {
attrs.poll.setProperties(poll);
this.appEvents.trigger("poll:voted", poll, attrs.post, attrs.vote);
if (attrs.poll.get("results") !== "on_close") {
state.showResults = true;
}