mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 19:23:16 +08:00
FIX: Find the closest post to jump to if deleted
This commit is contained in:
parent
ee0c41b53a
commit
732d0ad030
|
@ -454,7 +454,15 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
||||||
},
|
},
|
||||||
|
|
||||||
jumpToPost(postNumber) {
|
jumpToPost(postNumber) {
|
||||||
this._jumpToPostId(this.get('model.postStream').findPostIdForPostNumber(postNumber));
|
const postStream = this.get('model.postStream');
|
||||||
|
let postId = postStream.findPostIdForPostNumber(postNumber);
|
||||||
|
|
||||||
|
// If we couldn't find the post, find the closest post to it
|
||||||
|
if (!postId) {
|
||||||
|
const closest = postStream.closestPostNumberFor(postNumber);
|
||||||
|
postId = postStream.findPostIdForPostNumber(closest);
|
||||||
|
}
|
||||||
|
this._jumpToPostId(postId);
|
||||||
},
|
},
|
||||||
|
|
||||||
jumpTop() {
|
jumpTop() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user