Unverified Commit e7b5fb35 authored by benguedj's avatar benguedj Committed by GitHub
Browse files

fix: 馃悰 Corrige le loader sur la carto (access GPS : refused) (#540)

parent 2d14ab60
......@@ -17,6 +17,7 @@ interface Props {
postalCode: string;
region: Region;
setFetchedPois: (pois: CartographiePoisFromDB[]) => void;
setIsLoading: (value: boolean) => void;
chooseFilterMessage: () => void;
searchIsReady: boolean;
}
......@@ -26,6 +27,7 @@ const FetchPoisCoords: React.FC<Props> = ({
triggerSearchByGpsCoords,
region,
setFetchedPois,
setIsLoading,
chooseFilterMessage,
searchIsReady,
}) => {
......@@ -91,8 +93,10 @@ const FetchPoisCoords: React.FC<Props> = ({
};
useEffect(() => {
if (!searchIsReady) return;
if (!searchIsReady) {
setIsLoading(false);
return;
}
void searchByGPSCoords();
}, [triggerSearchByGpsCoords]);
......
......@@ -199,6 +199,7 @@ const TabAroundMeScreen: React.FC = () => {
postalCode={postalCodeInput}
region={region}
setFetchedPois={handleFetchedPois}
setIsLoading={setIsLoading}
chooseFilterMessage={() => {
setTimeout(
() => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment