From 1a696f0628ec3d2aec9975f347afbd7dfeb19d4b Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Sat, 18 Sep 2021 11:45:29 +0200 Subject: [PATCH] fix: infinite refresh if no internet --- src/components/Screens/RequestScreen.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Screens/RequestScreen.tsx b/src/components/Screens/RequestScreen.tsx index 10fa302..4339bf0 100644 --- a/src/components/Screens/RequestScreen.tsx +++ b/src/components/Screens/RequestScreen.tsx @@ -71,7 +71,8 @@ export default function RequestScreen(props: Props) { if (props.refresh !== lastRefresh.current) { lastRefresh.current = props.refresh === true; } - }, [props, loading, refreshData]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [props, loading]); useFocusEffect( React.useCallback(() => { @@ -89,7 +90,8 @@ export default function RequestScreen(props: Props) { 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) => {