1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

show dialog device util

This commit is contained in:
Kyle Spearrin
2018-02-02 23:42:33 -05:00
parent 269cacec45
commit 0a647e4846
5 changed files with 86 additions and 12 deletions

View File

@@ -175,7 +175,10 @@ export class AddEditComponent implements OnChanges {
}
async delete() {
if (!confirm(this.i18nService.t('deleteItemConfirmation'))) {
const confirmed = await this.platformUtilsService.showDialog(
this.i18nService.t('deleteItemConfirmation'), this.i18nService.t('deleteItem'),
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning')
if (!confirmed) {
return;
}
@@ -188,10 +191,14 @@ export class AddEditComponent implements OnChanges {
} catch { }
}
generatePassword() {
if (this.cipher.login != null && this.cipher.login.password != null && this.cipher.login.password.length &&
!confirm(this.i18nService.t('overwritePasswordConfirmation'))) {
return;
async generatePassword() {
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;
}
}
this.onGeneratePassword.emit();