FIX: proper jumpToPost with whispers/small-actions
findPostIdForPostNumber does not take into account whispers and small actions posts so the jump might end up on the wrong post.
This commit is contained in:
parent
ed1e5ef6cc
commit
72e38b291f
|
@ -690,20 +690,7 @@ export default Ember.Controller.extend(bufferedProperty("model"), {
|
|||
},
|
||||
|
||||
jumpToPost(postNumber) {
|
||||
if (this.get("model.postStream.isMegaTopic")) {
|
||||
this._jumpToPostNumber(postNumber);
|
||||
} else {
|
||||
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() {
|
||||
|
|
Loading…
Reference in New Issue