1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-13 01:58:44 +02:00

return confirmed from delete

This commit is contained in:
Kyle Spearrin 2018-04-11 16:27:10 -04:00
parent 44a9d17dba
commit 7bc65b8366

View File

@ -218,12 +218,12 @@ export class AddEditComponent {
this.onEditAttachments.emit(this.cipher); this.onEditAttachments.emit(this.cipher);
} }
async delete() { async delete(): Promise<boolean> {
const confirmed = await this.platformUtilsService.showDialog( const confirmed = await this.platformUtilsService.showDialog(
this.i18nService.t('deleteItemConfirmation'), this.i18nService.t('deleteItem'), this.i18nService.t('deleteItemConfirmation'), this.i18nService.t('deleteItem'),
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning'); this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
if (!confirmed) { if (!confirmed) {
return; return false;
} }
try { try {
@ -233,6 +233,8 @@ export class AddEditComponent {
this.toasterService.popAsync('success', null, this.i18nService.t('deletedItem')); this.toasterService.popAsync('success', null, this.i18nService.t('deletedItem'));
this.onDeletedCipher.emit(this.cipher); this.onDeletedCipher.emit(this.cipher);
} catch { } } catch { }
return true;
} }
async generatePassword(): Promise<boolean> { async generatePassword(): Promise<boolean> {