refactor: remove geoLocation from settings

Closes #99
This commit is contained in:
Jovan Krunić
2021-04-19 16:49:45 +02:00
parent 7928534d88
commit 3da7c7d009
7 changed files with 7 additions and 110 deletions

View File

@@ -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