Wait a few milliseconds before refreshing list

This commit is contained in:
Arnaud Vergnet 2020-09-21 17:34:51 +02:00
parent b654a928a2
commit 538d4d2187

View file

@ -99,7 +99,9 @@ class WebSectionList<T> extends React.PureComponent<PropsType<T>, StateType> {
*/
onScreenFocus = () => {
const {props} = this;
if (props.refreshOnFocus && this.lastRefresh) this.onRefresh();
if (props.refreshOnFocus && this.lastRefresh) {
setTimeout(this.onRefresh, 200);
}
if (props.autoRefreshTime > 0)
this.refreshInterval = setInterval(this.onRefresh, props.autoRefreshTime);
};