added safety check before reset in config

This commit is contained in:
jsangmeister 2019-10-30 09:56:43 +01:00
parent 98a7d4dcdf
commit 66f397f189
1 changed files with 7 additions and 2 deletions

View File

@ -106,8 +106,13 @@ export class ConfigListComponent extends BaseComponent implements CanComponentDe
/**
* This resets all values to their defaults.
*/
public resetAll(): void {
this.repo.resetGroups([this.configGroup.name]);
public async resetAll(): Promise<void> {
const title = this.translate.instant(
'Are you sure you want to reset this group? All custom changes will be lost.'
);
if (await this.promptDialog.open(title)) {
await this.repo.resetGroups([this.configGroup.name]);
}
}
/**