Skip to content

Commit 1649ee3

Browse files
Merge pull request #999 from GetStream/vishal/video-attachment-fix
fix: render attachment type video in FileAttachment view [CRNS-480]
2 parents 52ae8c3 + fab0993 commit 1649ee3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package/src/components/Attachment/Attachment.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ const AttachmentWithContext = <
8484
return <FileAttachment attachment={attachment} />;
8585
}
8686

87-
if (attachment.type === 'video' && attachment.asset_url && attachment.image_url) {
87+
if (attachment.type === 'video' && attachment.asset_url) {
8888
return (
8989
// TODO: Put in video component
90-
<Card {...attachment} />
90+
<FileAttachment attachment={attachment} />
9191
);
9292
}
9393

package/src/components/Message/Message.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ const MessageWithContext = <
468468
!message.deleted_at && Array.isArray(message.attachments)
469469
? message.attachments.reduce(
470470
(acc, cur) => {
471-
if (cur.type === 'file') {
471+
if (cur.type === 'file' || cur.type === 'video') {
472472
acc.files.push(cur);
473473
acc.other = []; // remove other attachments if a file exists
474474
} else if (cur.type === 'image' && !cur.title_link && !cur.og_scrape_url) {

0 commit comments

Comments
 (0)