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