@sumaris-net/ngx-components 2.4.65 → 2.4.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/app/shared/geolocation/geolocation.utils.mjs +11 -5
- package/fesm2015/sumaris-net.ngx-components.mjs +11 -4
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +10 -4
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -21678,10 +21678,16 @@ class GeolocationUtils {
|
|
|
21678
21678
|
// If capacitor : throw error (cannot fallback to browser geolocation, because of browser security limitation)
|
|
21679
21679
|
if (platform.is('capacitor')) {
|
|
21680
21680
|
console.error(`[geolocation-utils] Cannot get current geo location, using Capacitor: ${err?.message || ''} (code=${err?.code || 'null'})`);
|
|
21681
|
-
|
|
21682
|
-
|
|
21683
|
-
|
|
21684
|
-
|
|
21681
|
+
try {
|
|
21682
|
+
const permissions = await Geolocation.checkPermissions();
|
|
21683
|
+
console.error(`[geolocation-utils] Permissions: ${JSON.stringify(permissions)})`);
|
|
21684
|
+
const permissionDenied = (permissions?.coarseLocation || permissions?.location) === 'denied'
|
|
21685
|
+
|| (err?.message?.indexOf('Location permission was denied') !== -1);
|
|
21686
|
+
if (permissionDenied)
|
|
21687
|
+
throw { ...err, code: GeolocationPositionError.PERMISSION_DENIED };
|
|
21688
|
+
}
|
|
21689
|
+
catch (e2) {
|
|
21690
|
+
console.error(`[geolocation-utils] Error while calling checkPermissions(): ${err?.message || ''}`);
|
|
21685
21691
|
}
|
|
21686
21692
|
throw err;
|
|
21687
21693
|
}
|