Closed andygup closed 5 years ago
Suggestion to enhance useGeolocation.ts:
useGeolocation.ts
Replace these lines:
navigator.geolocation.getCurrentPosition(({ coords }) => { const { latitude, longitude } = coords; setState({ latitude, longitude }); });
With the following:
// Check if geolocation is enabled if ("geolocation" in navigator) { navigator.geolocation.getCurrentPosition(({ coords }) => { const { latitude, longitude } = coords; . . . }, error => { // handle geolocation errors }); } else { // gracefully handle in UI when no geolocation is available }
closed itself via new commit, but this is updated in the source now.
Suggestion to enhance
useGeolocation.ts
:Replace these lines:
With the following: