diff --git a/ts/components/conversation/message/message-content/MessageGenericAttachment.tsx b/ts/components/conversation/message/message-content/MessageGenericAttachment.tsx index a567233e0..4deaa1c36 100644 --- a/ts/components/conversation/message/message-content/MessageGenericAttachment.tsx +++ b/ts/components/conversation/message/message-content/MessageGenericAttachment.tsx @@ -15,19 +15,21 @@ const StyledGenericAttachmentContainer = styled(MessageHighlighter)<{ export function MessageGenericAttachment({ attachment, - direction, - highlight, + /** comes from the attachment iself or the component if it needs to be decrypted */ + pending, selected, + highlight, + direction, onClick, }: { attachment: PropsForAttachment | AttachmentTypeWithPath; - highlight: boolean; + pending: boolean; selected: boolean; + highlight: boolean; direction?: MessageModelType; onClick?: (e: any) => void; }) { - // TODO add higher level pending or loading states - const { pending, fileName, fileSize, contentType } = attachment; + const { fileName, fileSize, contentType } = attachment; const extension = getExtensionForDisplay({ contentType, fileName }); return ( diff --git a/ts/types/Attachment.ts b/ts/types/Attachment.ts index aec9057b5..436163e1d 100644 --- a/ts/types/Attachment.ts +++ b/ts/types/Attachment.ts @@ -156,7 +156,7 @@ export function isVideoAttachment(attachment?: AttachmentType): boolean { export function hasVideoScreenshot(attachments?: Array): boolean { const firstAttachment = attachments ? attachments[0] : null; - return Boolean(firstAttachment?.screenshot?.url); + return Boolean(firstAttachment?.screenshot?.url || firstAttachment?.pending); } type DimensionsType = {