forked from vergnet/application-amicale
fix: infinite refresh if no internet
This commit is contained in:
parent
9acfbf00df
commit
1a696f0628
1 changed files with 4 additions and 2 deletions
|
@ -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) => {
|
||||||
|
|
Loading…
Reference in a new issue