From fe0472da5cc6e53ffba509c08a77e274f9454451 Mon Sep 17 00:00:00 2001 From: Nick Krantz Date: Thu, 22 Jan 2026 14:32:01 -0600 Subject: [PATCH] separate decryption failure state in view --- .../src/vault/models/view/cipher.view.ts | 7 +- .../cipher-attachments.component.html | 109 ++++++++++-------- .../cipher-attachments.component.ts | 8 -- 3 files changed, 69 insertions(+), 55 deletions(-) diff --git a/libs/common/src/vault/models/view/cipher.view.ts b/libs/common/src/vault/models/view/cipher.view.ts index 07992b8d656..852970725c2 100644 --- a/libs/common/src/vault/models/view/cipher.view.ts +++ b/libs/common/src/vault/models/view/cipher.view.ts @@ -275,11 +275,14 @@ export class CipherView implements View, InitializerMetadata { return undefined; } - const attachments = obj.attachments?.map((a) => AttachmentView.fromSdkAttachmentView(a)) ?? []; + const attachments = obj.attachments?.map((a) => AttachmentView.fromSdkAttachmentView(a)!) ?? []; if (obj.attachmentDecryptionFailures?.length) { obj.attachmentDecryptionFailures.forEach((attachment) => { - attachments.push(AttachmentView.fromSdkAttachmentView(attachment, true)!); + const attachmentView = AttachmentView.fromSdkAttachmentView(attachment, true); + if (attachmentView) { + attachments.push(attachmentView); + } }); } diff --git a/libs/vault/src/cipher-form/components/attachments/cipher-attachments.component.html b/libs/vault/src/cipher-form/components/attachments/cipher-attachments.component.html index dd888e140cd..9308d2599ae 100644 --- a/libs/vault/src/cipher-form/components/attachments/cipher-attachments.component.html +++ b/libs/vault/src/cipher-form/components/attachments/cipher-attachments.component.html @@ -4,53 +4,72 @@ diff --git a/libs/vault/src/cipher-form/components/attachments/cipher-attachments.component.ts b/libs/vault/src/cipher-form/components/attachments/cipher-attachments.component.ts index ecd534fceb9..f75611b995e 100644 --- a/libs/vault/src/cipher-form/components/attachments/cipher-attachments.component.ts +++ b/libs/vault/src/cipher-form/components/attachments/cipher-attachments.component.ts @@ -190,14 +190,6 @@ export class CipherAttachmentsComponent { } } - getAttachmentFileName(attachment: AttachmentView): string { - if (attachment.hasDecryptionError) { - return this.i18nService.t("errorCannotDecrypt"); - } - - return attachment.fileName ?? ""; - } - /** Save the attachments to the cipher */ submit = async () => { this.onUploadStarted.emit();