Add an app event for when a topic is fully loaded

If we are interested in page events (say analytics), they are reported
when the route changes, which does not wait for any promises in
`setupController` to finish.

A plugin might want to know when a topic has fully loaded, so this event
is triggered when that happens.
This commit is contained in:
Robin Ward 2019-10-07 13:48:26 -04:00
parent 615039f228
commit 847f48a9d0
1 changed files with 1 additions and 0 deletions

View File

@ -52,6 +52,7 @@ export default Discourse.Route.extend({
enteredAt: new Date().getTime().toString()
});
this.appEvents.trigger("page:topic-loaded", topic);
topicController.subscribe();
// Highlight our post after the next render