From 5d8673321faf026ed88548470197c128c11a70f7 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Fri, 12 Feb 2021 13:06:27 -0500 Subject: [PATCH] DEV: Add poll:voted event (#12070) --- plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 b/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 index 5972107295a..08a0235248d 100644 --- a/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 +++ b/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 @@ -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; }