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

View File

@ -106,8 +106,13 @@ export class ConfigListComponent extends BaseComponent implements CanComponentDe
/** /**
* This resets all values to their defaults. * This resets all values to their defaults.
*/ */
public resetAll(): void { public async resetAll(): Promise<void> {
this.repo.resetGroups([this.configGroup.name]); 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]);
}
} }
/** /**