Fix issue with toggling the locator overlay too quickly (close #7814)

This commit is contained in:
Quincy Morgan
2020-07-20 11:49:49 -04:00
parent 36236d776b
commit 1f6a270535
2 changed files with 7 additions and 1 deletions
+2 -1
View File
@@ -23,7 +23,7 @@ export function uiGeolocate(context) {
function click() {
if (context.inIntro()) return;
if (!_layer.enabled()) {
if (!_layer.enabled() && !_locating.isShown()) {
// This timeout ensures that we still call finish() even if
// the user declines to share their location in Firefox
@@ -33,6 +33,7 @@ export function uiGeolocate(context) {
// get the latest position even if we already have one
navigator.geolocation.getCurrentPosition(success, error, _geolocationOptions);
} else {
_locating.close();
_layer.enabled(null, false);
updateButtonState();
}
+5
View File
@@ -51,5 +51,10 @@ export function uiLoading(context) {
};
loading.isShown = () => {
return _modalSelection && !_modalSelection.empty() && _modalSelection.node().parentNode;
};
return loading;
}