There was an error while loading. Please reload this page.
1 parent e43c31d commit 0dfcf71Copy full SHA for 0dfcf71
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