@vtex/pickup-points-modal
Advanced tools
Comparing version 0.1.35 to 0.1.36
@@ -70,16 +70,22 @@ 'use strict'; | ||
if (props.askForGeolocation && props.status === _constants.WAITING) { | ||
_this.handleGeolocationStatus(_constants.WAITING); | ||
navigator.permissions && navigator.permissions.query({ name: 'geolocation' }).then(function (permission) { | ||
_this.handleCurrentPosition(permission); | ||
}); | ||
// Hard coded coords for development | ||
if (window.location.host.includes(_constants.VTEXLOCAL) || window.location.host.includes(_constants.LOCALHOST)) { | ||
_this.getCurrentPositionSuccess({ | ||
coords: { | ||
latitude: -22.9432587, | ||
longitude: -43.1862642 | ||
} | ||
}); | ||
return; | ||
} | ||
props.googleMaps && (0, _CurrentPosition.getCurrentPosition)(_this.getCurrentPositionSuccess, _this.getCurrentPositionError); | ||
!navigator.permissions && _this.handleCurrentPosition(); | ||
} | ||
}, _this.handleCurrentPosition = function (permission) { | ||
_this.handleGeolocationStatus(permission && permission.state === _constants.GRANTED || window.location.host.includes(_constants.VTEXLOCAL) || window.location.host.includes(_constants.LOCALHOST) ? _constants.SEARCHING : _constants.WAITING); | ||
// Hard coded coords for development | ||
if (window.location.host.includes(_constants.VTEXLOCAL) || window.location.host.includes(_constants.LOCALHOST)) { | ||
_this.getCurrentPositionSuccess({ | ||
coords: { | ||
latitude: -22.9432587, | ||
longitude: -43.1862642 | ||
} | ||
}); | ||
return; | ||
} | ||
props.googleMaps && (0, _CurrentPosition.getCurrentPosition)(_this.getCurrentPositionSuccess, _this.getCurrentPositionError); | ||
}, _this.getCurrentPositionSuccess = function (position) { | ||
@@ -86,0 +92,0 @@ _this.handleGeolocationStatus(_constants.SEARCHING); |
{ | ||
"name": "@vtex/pickup-points-modal", | ||
"version": "0.1.35", | ||
"version": "0.1.36", | ||
"description": "Pickup Points Modal React component", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
253058
5487