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); this.appEvents.trigger('header:show-topic', topic);
} else { } else {
if (!DiscourseURL.isJumpScheduled()) { 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: { actions: {
enterTop() { 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() { 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, loadingAbove: null,
loadingBelow: null, loadingBelow: null,
loadingFilter: null, loadingFilter: null,
loadingNearPost: null,
stagingPost: null, stagingPost: null,
postsWithPlaceholders: null, postsWithPlaceholders: null,
timelineLookup: 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. // TODO: if we have all the posts in the filter, don't go to the server for them.
this.set('loadingFilter', true); this.set('loadingFilter', true);
this.set('loadingNearPost', opts.nearPost);
opts = _.merge(opts, this.get('streamFilters')); opts = _.merge(opts, this.get('streamFilters'));
@ -216,6 +218,8 @@ export default RestModel.extend({
}).catch(result => { }).catch(result => {
this.errorLoading(result); this.errorLoading(result);
throw result; throw result;
}).finally(() => {
this.set('loadingNearPost', null);
}); });
}, },