1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

pass full cipher to view component

This commit is contained in:
Nick Krantz
2024-10-04 09:51:39 -05:00
parent 1edc24e7b5
commit ca3a36952e

View File

@@ -500,7 +500,7 @@ export class VaultComponent implements OnInit, OnDestroy {
} }
if (action === "view") { if (action === "view") {
await this.viewCipherById(cipherId); await this.viewCipherById(cipher);
} else { } else {
await this.editCipherId(cipherId, false); await this.editCipherId(cipherId, false);
} }
@@ -879,10 +879,7 @@ export class VaultComponent implements OnInit, OnDestroy {
} }
/** Opens the view dialog for the given cipher unless password reprompt fails */ /** Opens the view dialog for the given cipher unless password reprompt fails */
async viewCipherById(id: string) { async viewCipherById(cipher: CipherView) {
const cipher = await this.cipherService.get(id);
// If cipher exists (cipher is null when new) and MP reprompt
// is on for this cipher, then show password reprompt.
if ( if (
cipher && cipher &&
cipher.reprompt !== 0 && cipher.reprompt !== 0 &&
@@ -895,7 +892,7 @@ export class VaultComponent implements OnInit, OnDestroy {
const cipherFormConfig = await this.cipherFormConfigService.buildConfig( const cipherFormConfig = await this.cipherFormConfigService.buildConfig(
cipher?.edit ? "edit" : "partial-edit", cipher?.edit ? "edit" : "partial-edit",
id as CipherId, cipher.id as CipherId,
cipher?.type, cipher?.type,
); );