From 09e2736cbcc267594b660beabbd001d9030f9880 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Sun, 29 Nov 2020 18:33:29 -0500 Subject: [PATCH] Fix goToIndex to visible end In the PostStream, `this.visibleEnd` represents the index of the last post + 1, but `loadNearIndex` treated it as if it was the index of the last post. This means that executing `goToIndex` on the post stream's current `this.visiblePost` didn't load new posts, and as a result, the requested scrolling did not occur. --- js/src/forum/states/PostStreamState.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/forum/states/PostStreamState.js b/js/src/forum/states/PostStreamState.js index d4d73b5fb..577a3f7b1 100644 --- a/js/src/forum/states/PostStreamState.js +++ b/js/src/forum/states/PostStreamState.js @@ -172,7 +172,7 @@ class PostStreamState { * @return {Promise} */ loadNearIndex(index) { - if (index >= this.visibleStart && index <= this.visibleEnd) { + if (index >= this.visibleStart && index < this.visibleEnd) { return Promise.resolve(); }