Skip to content

Commit

Permalink
Use high accuracy geolocation (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
yulapshun authored Jan 18, 2025
1 parent c81d307 commit 85ea2b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const Header = () => {
navigator.geolocation.getCurrentPosition(
({ coords: { latitude, longitude } }) => {
updateGeolocation({ lat: latitude, lng: longitude });
}
},
{ enableHighAccuracy: true }
);
} catch (e) {
console.log("error in getting location");
Expand Down
4 changes: 3 additions & 1 deletion src/context/AppContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export const AppContextProvider = ({ children }: AppContextProviderProps) => {
({ coords: { latitude, longitude } }) => {
updateGeolocation({ lat: latitude, lng: longitude });
}
{ enableHighAccuracy: true }

Check failure on line 302 in src/context/AppContext.tsx

View workflow job for this annotation

GitHub Actions / build (20.x)

',' expected.

Check failure on line 302 in src/context/AppContext.tsx

View workflow job for this annotation

GitHub Actions / build (22.x)

',' expected.
);
geoWatcherId.current = _geoWatcherId;
} catch (e) {
Expand Down Expand Up @@ -355,7 +356,8 @@ export const AppContextProvider = ({ children }: AppContextProviderProps) => {
() => {
setGeoPermission("denied");
if (deniedCallback) deniedCallback();
}
},
{ enableHighAccuracy: true }
);
console.log(geoWatcherId.current);
}
Expand Down

0 comments on commit 85ea2b1

Please sign in to comment.