From 72e38b291f374694f9e2672f2f5749978f5092e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 18 Sep 2019 18:32:40 +0200 Subject: [PATCH] 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. --- .../discourse/controllers/topic.js.es6 | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6 index fbfdc0f4864..6cb4ecf0bee 100644 --- a/app/assets/javascripts/discourse/controllers/topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic.js.es6 @@ -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() {