From 1260f69ed05572c5fbbb2ff26350a2625d62ccee Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Thu, 2 Apr 2026 17:57:44 +0200 Subject: [PATCH] fix(web): fix type errors in dmFormatters PreviewAttachment handling --- packages/web/src/utils/dmFormatters.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web/src/utils/dmFormatters.ts b/packages/web/src/utils/dmFormatters.ts index 37845198..7fa3405f 100644 --- a/packages/web/src/utils/dmFormatters.ts +++ b/packages/web/src/utils/dmFormatters.ts @@ -46,7 +46,7 @@ function getAttachmentLabel(mimeType: string, name: string): string { */ function getUnifiedAttachmentIcon(attachments: PreviewAttachment[]): string { const icons = new Set(attachments.map(a => getAttachmentIcon(resolveAttachmentType(a)))); - return icons.size === 1 ? [...icons][0] : '📎'; + return icons.size === 1 ? [...icons][0]! : '📎'; } /** @@ -74,7 +74,7 @@ export function formatDmPreview(lastMessage: PreviewMessage | null | undefined): if (!hasText && hasAttachments) { if (attachments!.length === 1) { - const a = attachments![0]; + const a = attachments![0]!; return getAttachmentLabel(resolveAttachmentType(a), resolveAttachmentName(a)); } return `📎 ${attachments!.length} files`;