mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-03-12 01:32:12 +00:00
@@ -62,30 +62,6 @@ export class SettingsItemComponent {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for user permission to use location,
|
||||
* if no permission is granted, setting is set to false and an alert is presented to the user
|
||||
*/
|
||||
private async checkGeoLocationPermission() {
|
||||
const permissionGranted = await this.settingsProvider.checkGeoLocationPermission();
|
||||
if (!permissionGranted) {
|
||||
// revert setting value
|
||||
this.setting.value = false;
|
||||
await this.presentGeoLocationAlert();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows alert with error message on denied user permission or disabled location services
|
||||
*/
|
||||
private async presentGeoLocationAlert() {
|
||||
const title = await this.translateService.get('settings.geoLocation.permission_denied_title')
|
||||
.toPromise();
|
||||
const message = await this.translateService.get('settings.geoLocation.permission_denied_message')
|
||||
.toPromise();
|
||||
await this.presentAlert(title, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows alert with given title and message and a 'ok' button
|
||||
*
|
||||
@@ -112,11 +88,6 @@ export class SettingsItemComponent {
|
||||
case 'language':
|
||||
this.translateService.use(this.setting.value as SCLanguageCode);
|
||||
break;
|
||||
case 'geoLocation':
|
||||
if (!!this.setting.value) {
|
||||
await this.checkGeoLocationPermission();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
await this.settingsProvider
|
||||
|
||||
Reference in New Issue
Block a user