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:
Régis Hanol 2019-09-18 18:32:40 +02:00
parent ed1e5ef6cc
commit 72e38b291f
1 changed files with 1 additions and 14 deletions

View File

@ -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);
}
this._jumpToPostNumber(postNumber);
},
jumpTop() {