Browse Source

fix: infinite refresh if no internet

Arnaud Vergnet 2 years ago
parent
commit
1a696f0628
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/components/Screens/RequestScreen.tsx

+ 4
- 2
src/components/Screens/RequestScreen.tsx View File

@@ -71,7 +71,8 @@ export default function RequestScreen<T>(props: Props<T>) {
71 71
     if (props.refresh !== lastRefresh.current) {
72 72
       lastRefresh.current = props.refresh === true;
73 73
     }
74
-  }, [props, loading, refreshData]);
74
+    // eslint-disable-next-line react-hooks/exhaustive-deps
75
+  }, [props, loading]);
75 76
 
76 77
   useFocusEffect(
77 78
     React.useCallback(() => {
@@ -89,7 +90,8 @@ export default function RequestScreen<T>(props: Props<T>) {
89 90
           clearInterval(refreshInterval.current);
90 91
         }
91 92
       };
92
-    }, [props.cache, props.refreshOnFocus, props.autoRefreshTime, refreshData])
93
+      // eslint-disable-next-line react-hooks/exhaustive-deps
94
+    }, [props.cache, props.refreshOnFocus, props.autoRefreshTime])
93 95
   );
94 96
 
95 97
   const isErrorCritical = (e: API_REQUEST_CODES | undefined) => {

Loading…
Cancel
Save