diff --git a/src/location-provider/LocationProvider.tsx b/src/location-provider/LocationProvider.tsx index 470611b..a76b31f 100644 --- a/src/location-provider/LocationProvider.tsx +++ b/src/location-provider/LocationProvider.tsx @@ -19,11 +19,14 @@ export const LocationProvider: React.FC<{ location: null, }) - const updateLocation = async () => { - const position = await getCurrentLocation(highAccuracy).catch( - () => location.location - ) - setLocation({ location: position }) + const updateLocation = () => { + getCurrentLocation(highAccuracy) + .then((position) => { + setLocation({ location: position }) + }) + .catch(() => { + setLocation({ location: null }) + }) } useEffect(() => {