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:
committed by
GitHub
parent
09a39d5d95
commit
f9704f9153
@@ -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;
|
||||
|
Reference in New Issue
Block a user