PM-9632 added MP reprompt check to edit button in view-v2 (#10104)

This commit is contained in:
Jason Ng 2024-07-12 16:19:22 -04:00 committed by GitHub
parent 81a3dce774
commit b7e102dd6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 5 deletions

View File

@ -102,7 +102,20 @@ export class ViewV2Component {
return await cipher.decrypt(await this.cipherService.getKeyForCipherKeyDecryption(cipher));
}
editCipher() {
async checkForPasswordReprompt() {
this.passwordReprompted =
this.passwordReprompted ||
(await this.passwordRepromptService.passwordRepromptCheck(this.cipher));
if (!this.passwordReprompted) {
return false;
}
return true;
}
async editCipher() {
if (!(await this.checkForPasswordReprompt())) {
return;
}
if (this.cipher.isDeleted) {
return false;
}
@ -113,10 +126,7 @@ export class ViewV2Component {
}
delete = async (): Promise<boolean> => {
this.passwordReprompted =
this.passwordReprompted ||
(await this.passwordRepromptService.passwordRepromptCheck(this.cipher));
if (!this.passwordReprompted) {
if (!(await this.checkForPasswordReprompt())) {
return;
}