FIX: Topic title wasn't showing properly when entering lower in topics

This commit is contained in:
Robin Ward 2017-03-28 16:28:26 -04:00
parent 322ed7124e
commit f3540332a8
3 changed files with 14 additions and 3 deletions

View File

@ -142,7 +142,10 @@ export default Ember.Component.extend(AddArchetypeClass, Scrolling, {
this.appEvents.trigger('header:show-topic', topic);
} else {
if (!DiscourseURL.isJumpScheduled()) {
this.appEvents.trigger('header:hide-topic');
const loadingNear = topic.get('postStream.loadingNearPost') || 1;
if (loadingNear === 1) {
this.appEvents.trigger('header:hide-topic');
}
}
}
}

View File

@ -94,11 +94,15 @@ export default Ember.Component.extend(CleansUp, {
actions: {
enterTop() {
DiscourseURL.routeTo(this.get('topic.url'));
const topic = this.get('topic');
this.appEvents.trigger('header:update-topic', topic);
DiscourseURL.routeTo(topic.get('url'));
},
enterBottom() {
DiscourseURL.routeTo(this.get('topic.lastPostUrl'));
const topic = this.get('topic');
this.appEvents.trigger('header:update-topic', topic);
DiscourseURL.routeTo(topic.get('lastPostUrl'));
}
}
});

View File

@ -15,6 +15,7 @@ export default RestModel.extend({
loadingAbove: null,
loadingBelow: null,
loadingFilter: null,
loadingNearPost: null,
stagingPost: null,
postsWithPlaceholders: null,
timelineLookup: null,
@ -206,6 +207,7 @@ export default RestModel.extend({
// TODO: if we have all the posts in the filter, don't go to the server for them.
this.set('loadingFilter', true);
this.set('loadingNearPost', opts.nearPost);
opts = _.merge(opts, this.get('streamFilters'));
@ -216,6 +218,8 @@ export default RestModel.extend({
}).catch(result => {
this.errorLoading(result);
throw result;
}).finally(() => {
this.set('loadingNearPost', null);
});
},