FIX: Double header rendering issues, redux

This commit is contained in:
Robin Ward 2017-06-22 12:50:46 -04:00
parent 94cee37edd
commit b22df9f166
2 changed files with 11 additions and 6 deletions

View File

@ -92,17 +92,18 @@ export default Ember.Component.extend(CleansUp, {
this.appEvents.off('topic-entrance:show');
},
_jumpTo(destination) {
this.cleanUp();
DiscourseURL.routeTo(destination);
},
actions: {
enterTop() {
const topic = this.get('topic');
this.appEvents.trigger('header:update-topic', topic);
DiscourseURL.routeTo(topic.get('url'));
this._jumpTo(this.get('topic.url'));
},
enterBottom() {
const topic = this.get('topic');
this.appEvents.trigger('header:update-topic', topic);
DiscourseURL.routeTo(topic.get('lastPostUrl'));
this._jumpTo(this.get('topic.lastPostUrl'));
}
}
});

View File

@ -218,6 +218,10 @@ const TopicRoute = Discourse.Route.extend({
// We reset screen tracking every time a topic is entered
this.screenTrack.start(model.get('id'), controller);
Ember.run.scheduleOnce('afterRender', () => {
this.appEvents.trigger('header:update-topic', model);
});
}
});