Log an event for `topic:created`

Log an event for topic:created

You can distinguish between post:created and topic:created now.

diff --git a/app/assets/javascripts/discourse/models/composer.js.es6 b/app/assets/javascripts/discourse/models/composer.js.es6
index e77a7a4..de9d904 100644
--- a/app/assets/javascripts/discourse/models/composer.js.es6
+++ b/app/assets/javascripts/discourse/models/composer.js.es6
@@ -941,7 +941,11 @@ const Composer = RestModel.extend({
 
         composer.clearState();
         composer.set("createdPost", createdPost);
-        this.appEvents.trigger("post:created", createdPost);
+        if (composer.replyingToTopic) {
+          this.appEvents.trigger("post:created", createdPost);
+        } else {
+          this.appEvents.trigger("topic:created", createdPost, composer);
+        }
 
         if (addedToStream) {
           composer.set("composeState", CLOSED);

GitHub sha: d527f3a7

1 Like