From 50fae909d63d1c14f546c2ed0d2241a8ac05ae3e Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 8 Oct 2019 10:12:03 -0400 Subject: [PATCH] Add an appEvent for when a post is created List for `post:created` and you'll be passed the new post when it is created. --- app/assets/javascripts/discourse/models/composer.js.es6 | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/discourse/models/composer.js.es6 b/app/assets/javascripts/discourse/models/composer.js.es6 index ebe6d5aa6e5..e77a7a48e9e 100644 --- a/app/assets/javascripts/discourse/models/composer.js.es6 +++ b/app/assets/javascripts/discourse/models/composer.js.es6 @@ -941,6 +941,7 @@ const Composer = RestModel.extend({ composer.clearState(); composer.set("createdPost", createdPost); + this.appEvents.trigger("post:created", createdPost); if (addedToStream) { composer.set("composeState", CLOSED);