Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout for geolocation.getCurrentPosition call #1385

Merged
merged 2 commits into from
Dec 7, 2020

Conversation

Gnito
Copy link
Contributor

@Gnito Gnito commented Dec 4, 2020

No description provided.

@@ -104,12 +104,18 @@ export const userLocation = () =>
return;
}

const options = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are these options coming from? Why do we need e.g. enableHighAccuracy to be true? I think having some kind of code comment to explain would be nice

Copy link
Contributor Author

@Gnito Gnito Dec 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OtterleyW Good point. 👍

They actually come from here: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition
I thought that "enableHighAccuracy: true" is a better default for templates since using false gave me a position that was 1km off.

@Gnito Gnito force-pushed the add-timeout-for-getcurrentposition branch from 4315347 to 9c57a79 Compare December 7, 2020 14:35
@Gnito Gnito merged commit 91689e3 into master Dec 7, 2020
@Gnito Gnito deleted the add-timeout-for-getcurrentposition branch December 7, 2020 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants