fix: infinite refresh if no internet

This commit is contained in:
Arnaud Vergnet 2021-09-18 11:45:29 +02:00
parent 9acfbf00df
commit 1a696f0628

View file

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