@sumaris-net/ngx-components 2.4.66 → 2.4.68
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 +7 -12
- package/fesm2015/sumaris-net.ngx-components.mjs +6 -11
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +6 -11
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -21677,17 +21677,12 @@ class GeolocationUtils {
|
|
|
21677
21677
|
catch (err) {
|
|
21678
21678
|
// If capacitor : throw error (cannot fallback to browser geolocation, because of browser security limitation)
|
|
21679
21679
|
if (platform.is('capacitor')) {
|
|
21680
|
-
console.error(`[geolocation-utils] Cannot get current geo location, using Capacitor: ${err?.message || ''}
|
|
21681
|
-
|
|
21682
|
-
|
|
21683
|
-
|
|
21684
|
-
|
|
21685
|
-
|
|
21686
|
-
throw { ...err, code: GeolocationPositionError.PERMISSION_DENIED };
|
|
21687
|
-
}
|
|
21688
|
-
}
|
|
21689
|
-
catch (e2) {
|
|
21690
|
-
console.error(`[geolocation-utils] Error while calling checkPermissions(): ${err?.message || ''}`);
|
|
21680
|
+
console.error(`[geolocation-utils] Cannot get current geo location, using Capacitor: ${err?.message || ''}`);
|
|
21681
|
+
// Detect a permission error, to add code
|
|
21682
|
+
// FIXME - Capacitor use hardcoded strings! (see https://github.com/ionic-team/capacitor-plugins)
|
|
21683
|
+
const message = (err?.message || '').toLowerCase();
|
|
21684
|
+
if (message.includes('location permission was denied') || message.includes('location disabled')) {
|
|
21685
|
+
throw { ...err, code: GeolocationPositionError.PERMISSION_DENIED };
|
|
21691
21686
|
}
|
|
21692
21687
|
throw err;
|
|
21693
21688
|
}
|