There was an error while loading. Please reload this page.
2 parents e43c31d + 0dfcf71 commit e262fd9Copy full SHA for e262fd9
1 file changed
src/location-provider/LocationProvider.tsx
@@ -19,11 +19,14 @@ export const LocationProvider: React.FC<{
19
location: null,
20
})
21
22
- const updateLocation = async () => {
23
- const position = await getCurrentLocation(highAccuracy).catch(
24
- () => location.location
25
- )
26
- setLocation({ location: position })
+ const updateLocation = () => {
+ getCurrentLocation(highAccuracy)
+ .then((position) => {
+ setLocation({ location: position })
+ })
27
+ .catch(() => {
28
+ setLocation({ location: null })
29
30
}
31
32
useEffect(() => {
0 commit comments