Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
return boolean from generate password
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Apr 10, 2018
1 parent f8d8ca2 commit fa5f6c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/angular/components/add-edit.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,18 @@ export class AddEditComponent {
} catch { }
}

async generatePassword() {
async generatePassword(): Promise<boolean> {
if (this.cipher.login != null && this.cipher.login.password != null && this.cipher.login.password.length) {
const confirmed = await this.platformUtilsService.showDialog(
this.i18nService.t('overwritePasswordConfirmation'), this.i18nService.t('overwritePassword'),
this.i18nService.t('yes'), this.i18nService.t('no'));
if (!confirmed) {
return;
return false;
}
}

this.onGeneratePassword.emit();
return true;
}

togglePassword() {
Expand Down

0 comments on commit fa5f6c0

Please sign in to comment.