forked from Ivasoft/mattermost-mobile
Check initialIndex in callback (#3065)
This commit is contained in:
committed by
Miguel Alatzar
parent
f71d9568ce
commit
361528de86
@@ -201,10 +201,8 @@ export default class PostList extends PureComponent {
|
||||
};
|
||||
|
||||
handleScrollToIndexFailed = () => {
|
||||
requestAnimationFrame(() => {
|
||||
this.hasDoneInitialScroll = false;
|
||||
this.scrollToInitialIndexIfNeeded(1, 1);
|
||||
});
|
||||
this.hasDoneInitialScroll = false;
|
||||
this.scrollToInitialIndexIfNeeded(1, 1);
|
||||
};
|
||||
|
||||
handleSetScrollToBottom = () => {
|
||||
@@ -291,11 +289,10 @@ export default class PostList extends PureComponent {
|
||||
if (
|
||||
width > 0 &&
|
||||
height > 0 &&
|
||||
this.props.initialIndex > 0 &&
|
||||
!this.hasDoneInitialScroll
|
||||
) {
|
||||
requestAnimationFrame(() => {
|
||||
if (this.flatListRef?.current) {
|
||||
if (this.props.initialIndex > 0 && this.flatListRef?.current) {
|
||||
this.flatListRef.current.scrollToIndex({
|
||||
animated: false,
|
||||
index: this.props.initialIndex,
|
||||
|
||||
Reference in New Issue
Block a user