Skip to content

Commit

Permalink
Fix goToIndex to visible end
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
askvortsov1 committed Nov 29, 2020
1 parent ddb3d3e commit 09e2736
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/src/forum/states/PostStreamState.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 09e2736

Please sign in to comment.