commit
facda7002b
|
@ -502,6 +502,7 @@
|
|||
"addon.mod_data.foundrecords": "data",
|
||||
"addon.mod_data.gettinglocation": "local_moodlemobileapp",
|
||||
"addon.mod_data.latlongboth": "data",
|
||||
"addon.mod_data.locationpermissiondenied": "local_moodlemobileapp",
|
||||
"addon.mod_data.menuchoose": "data",
|
||||
"addon.mod_data.modulenameplural": "data",
|
||||
"addon.mod_data.more": "data",
|
||||
|
|
|
@ -117,9 +117,19 @@ export class AddonModDataFieldLatlongComponent extends AddonModDataFieldPluginCo
|
|||
this.form.controls['f_' + this.field.id + '_0'].setValue(result.coords.latitude);
|
||||
this.form.controls['f_' + this.field.id + '_1'].setValue(result.coords.longitude);
|
||||
}).catch((error) => {
|
||||
if (this.isPermissionDeniedError(error)) {
|
||||
this.domUtils.showErrorModal('addon.mod_data.locationpermissiondenied', true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.domUtils.showErrorModalDefault(error, 'Error getting location');
|
||||
}).finally(() => {
|
||||
modal.dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
protected isPermissionDeniedError(error?: any): boolean {
|
||||
return error && 'code' in error && 'PERMISSION_DENIED' in error && error.code === error.PERMISSION_DENIED;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
"foundrecords": "Found records: {{$a.num}}/{{$a.max}} (<a href=\"{{$a.reseturl}}\">Reset filters</a>)",
|
||||
"gettinglocation": "Getting location",
|
||||
"latlongboth": "Both latitude and longitude are required.",
|
||||
"locationpermissiondenied": "Permission to access your location has been denied.",
|
||||
"menuchoose": "Choose...",
|
||||
"modulenameplural": "Databases",
|
||||
"more": "More",
|
||||
|
|
|
@ -501,6 +501,7 @@
|
|||
"addon.mod_data.foundrecords": "Found records: {{$a.num}}/{{$a.max}} (<a href=\"{{$a.reseturl}}\">Reset filters</a>)",
|
||||
"addon.mod_data.gettinglocation": "Getting location",
|
||||
"addon.mod_data.latlongboth": "Both latitude and longitude are required.",
|
||||
"addon.mod_data.locationpermissiondenied": "Permission to access your location has been denied.",
|
||||
"addon.mod_data.menuchoose": "Choose...",
|
||||
"addon.mod_data.modulenameplural": "Databases",
|
||||
"addon.mod_data.more": "More",
|
||||
|
|
Loading…
Reference in New Issue