1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

refactor utils service to utils

This commit is contained in:
Kyle Spearrin
2018-04-23 13:03:47 -04:00
parent 5e7115f78d
commit 0fa9fc58eb
16 changed files with 168 additions and 250 deletions

View File

@@ -28,7 +28,7 @@ export class PasswordGeneratorComponent implements OnInit {
async ngOnInit() {
this.options = await this.passwordGenerationService.getOptions();
this.avoidAmbiguous = !this.options.ambiguous;
this.password = this.passwordGenerationService.generatePassword(this.options);
this.password = await this.passwordGenerationService.generatePassword(this.options);
this.analytics.eventTrack.next({ action: 'Generated Password' });
await this.passwordGenerationService.addHistory(this.password);
}
@@ -41,7 +41,7 @@ export class PasswordGeneratorComponent implements OnInit {
async sliderInput() {
this.normalizeOptions();
this.password = this.passwordGenerationService.generatePassword(this.options);
this.password = await this.passwordGenerationService.generatePassword(this.options);
}
async saveOptions(regenerate: boolean = true) {
@@ -54,7 +54,7 @@ export class PasswordGeneratorComponent implements OnInit {
}
async regenerate() {
this.password = this.passwordGenerationService.generatePassword(this.options);
this.password = await this.passwordGenerationService.generatePassword(this.options);
await this.passwordGenerationService.addHistory(this.password);
this.analytics.eventTrack.next({ action: 'Regenerated Password' });
}