Browse Source

Wait a few milliseconds before refreshing list

Arnaud Vergnet 3 years ago
parent
commit
538d4d2187
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/components/Screens/WebSectionList.js

+ 3
- 1
src/components/Screens/WebSectionList.js View File

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

Loading…
Cancel
Save