Merge pull request #5096 from jsangmeister/settings-safety-check

Added safety check before reset in config
This commit is contained in:
Sean 2019-10-30 11:23:44 +01:00 committed by GitHub
commit d12bf299cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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]);
}
} }
/** /**