copy default options (#764)

This commit is contained in:
Kyle Spearrin 2022-04-11 22:39:05 -04:00 committed by GitHub
parent 0f0adc9bd9
commit 017fb5146f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -180,7 +180,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
async getOptions(): Promise<[any, PasswordGeneratorPolicyOptions]> {
let options = await this.stateService.getPasswordGenerationOptions();
if (options == null) {
options = DefaultOptions;
options = Object.assign({}, DefaultOptions);
} else {
options = Object.assign({}, DefaultOptions, options);
}

View File

@ -97,7 +97,7 @@ export class UsernameGenerationService implements BaseUsernameGenerationService
async getOptions(): Promise<any> {
let options = await this.stateService.getUsernameGenerationOptions();
if (options == null) {
options = DefaultOptions;
options = Object.assign({}, DefaultOptions);
} else {
options = Object.assign({}, DefaultOptions, options);
}