mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 02:53:45 +08:00
FIX: Back button broken navigating from one topic back to another
This commit is contained in:
parent
e8527c5e3e
commit
0660a905b8
|
@ -150,12 +150,16 @@ const PostStream = RestModel.extend({
|
|||
opts = opts || {};
|
||||
opts.nearPost = parseInt(opts.nearPost, 10);
|
||||
|
||||
const topic = this.get('topic'),
|
||||
self = this;
|
||||
const topic = this.get('topic');
|
||||
const self = this;
|
||||
|
||||
// Do we already have the post in our list of posts? Jump there.
|
||||
const postWeWant = this.get('posts').findProperty('post_number', opts.nearPost);
|
||||
if (postWeWant) { return Ember.RSVP.resolve(); }
|
||||
if (opts.forceLoad) {
|
||||
this.set('loaded', false);
|
||||
} else {
|
||||
const postWeWant = this.get('posts').findProperty('post_number', opts.nearPost);
|
||||
if (postWeWant) { return Ember.RSVP.resolve(); }
|
||||
}
|
||||
|
||||
// TODO: if we have all the posts in the filter, don't go to the server for them.
|
||||
self.set('loadingFilter', true);
|
||||
|
|
|
@ -18,6 +18,7 @@ export default Discourse.Route.extend({
|
|||
if (params.nearPost === "last") { params.nearPost = 999999999; }
|
||||
|
||||
var self = this;
|
||||
params.forceLoad = true;
|
||||
postStream.refresh(params).then(function () {
|
||||
|
||||
// TODO we are seeing errors where closest post is null and this is exploding
|
||||
|
|
Loading…
Reference in New Issue
Block a user