mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -06:00
FIX: Jumping to a post that doesn't exist should jump to closest
This commit is contained in:
parent
bff36de130
commit
09cb61b533
@ -274,18 +274,17 @@ const DiscourseURL = Ember.Object.extend({
|
||||
|
||||
if (newMatches[3]) { opts.nearPost = newMatches[3]; }
|
||||
if (path.match(/last$/)) { opts.nearPost = topicController.get('model.highest_post_number'); }
|
||||
const closest = opts.nearPost || 1;
|
||||
|
||||
opts.cancelSummary = true;
|
||||
|
||||
postStream.refresh(opts).then(() => {
|
||||
const closest = postStream.closestPostNumberFor(opts.nearPost || 1);
|
||||
topicController.setProperties({
|
||||
'model.currentPost': closest,
|
||||
enteredAt: new Date().getTime().toString()
|
||||
});
|
||||
|
||||
this.appEvents.trigger('post:highlight', closest);
|
||||
}).then(() => {
|
||||
const jumpOpts = {
|
||||
skipIfOnScreen: routeOpts.skipIfOnScreen
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user