Stop calling onEndReached unnecessarily
This commit is contained in:
parent
7b526fe700
commit
ae7398233a
|
@ -216,7 +216,13 @@ class ListContainer extends React.Component<IListContainerProps, IListContainerS
|
||||||
}
|
}
|
||||||
}, 300);
|
}, 300);
|
||||||
|
|
||||||
onEndReached = () => this.query();
|
onEndReached = () => {
|
||||||
|
const { messages } = this.state;
|
||||||
|
if (messages.length < this.count) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.query();
|
||||||
|
};
|
||||||
|
|
||||||
onRefresh = () =>
|
onRefresh = () =>
|
||||||
this.setState({ refreshing: true }, async () => {
|
this.setState({ refreshing: true }, async () => {
|
||||||
|
|
Loading…
Reference in New Issue