1
0
mirror of https://github.com/flarum/core.git synced 2025-10-13 07:54:25 +02:00

Fix multiple scrolls to same post in PostStream (#2264)

While more pleasant from an FSM standpoint, comparing the current targetPost to the previous one does not work if goToNumber is called twice in a row for the same post. For instance, if a user clicks the mentions link to a post twice, the post stream breaks.
This commit is contained in:
Alexander Skvortsov
2020-10-01 14:50:54 -04:00
committed by GitHub
parent 09a39d5d95
commit f9704f9153
2 changed files with 4 additions and 9 deletions

View File

@@ -103,6 +103,7 @@ class PostStreamState {
this.loadPromise = this.loadNearNumber(number);
this.needsScroll = true;
this.targetPost = { number };
this.animateScroll = !noAnimation;
this.number = number;
@@ -127,6 +128,7 @@ class PostStreamState {
this.loadPromise = this.loadNearIndex(index);
this.needsScroll = true;
this.targetPost = { index };
this.animateScroll = !noAnimation;
this.index = index;