From ca3a36952e6ae96f59d415ca92fa068f2bfca36d Mon Sep 17 00:00:00 2001 From: Nick Krantz Date: Fri, 4 Oct 2024 09:51:39 -0500 Subject: [PATCH] pass full cipher to view component --- apps/web/src/app/vault/org-vault/vault.component.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/vault/org-vault/vault.component.ts b/apps/web/src/app/vault/org-vault/vault.component.ts index 5c77ce4ab10..51ca56be7b5 100644 --- a/apps/web/src/app/vault/org-vault/vault.component.ts +++ b/apps/web/src/app/vault/org-vault/vault.component.ts @@ -500,7 +500,7 @@ export class VaultComponent implements OnInit, OnDestroy { } if (action === "view") { - await this.viewCipherById(cipherId); + await this.viewCipherById(cipher); } else { 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 */ - async viewCipherById(id: string) { - 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. + async viewCipherById(cipher: CipherView) { if ( cipher && cipher.reprompt !== 0 && @@ -895,7 +892,7 @@ export class VaultComponent implements OnInit, OnDestroy { const cipherFormConfig = await this.cipherFormConfigService.buildConfig( cipher?.edit ? "edit" : "partial-edit", - id as CipherId, + cipher.id as CipherId, cipher?.type, );