Skip to content
5 changes: 5 additions & 0 deletions .changeset/attachment-collapse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fixed Attachments not respecting collapse property when using incoming webhook
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import AttachmentsItem from './attachments/AttachmentsItem';

type AttachmentsProps = {
attachments: MessageAttachmentBase[];
collapsed?: boolean;
id?: string | undefined;
};

const Attachments = ({ attachments, collapsed, id }: AttachmentsProps): ReactElement => {
const Attachments = ({ attachments, id }: AttachmentsProps): ReactElement => {
return (
<>
{attachments?.map((attachment, index) => (
<AttachmentsItem key={index} id={id} attachment={{ ...attachment, collapsed }} />
<AttachmentsItem key={index} id={id} attachment={{ ...attachment }} />
))}
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const QuoteAttachment = ({ attachment }: QuoteAttachmentProps): ReactElem
{attachment.md ? <MessageContentBody md={attachment.md} /> : attachment.text.substring(attachment.text.indexOf('\n') + 1)}
{attachment.attachments && (
<AttachmentInner>
<Attachments attachments={attachment.attachments} collapsed={attachment.collapsed} />
<Attachments attachments={attachment.attachments} />
</AttachmentInner>
)}
</AttachmentDetails>
Expand Down