|
|
|
@ -174,8 +174,14 @@ class SessionRightPanel extends React.Component<Props, State> {
|
|
|
|
|
// Unlike visual media, only one non-image attachment is supported
|
|
|
|
|
const documents = rawDocuments.map(
|
|
|
|
|
(message: { attachments: Array<any> }) => {
|
|
|
|
|
const attachments = message.attachments || [];
|
|
|
|
|
const attachment = attachments[0];
|
|
|
|
|
// this is to not fail if the attachment is invalid (could be a Long Attachment type which is not supported)
|
|
|
|
|
if (!message.attachments?.length) {
|
|
|
|
|
window.log.info(
|
|
|
|
|
'Got a message with an empty list of attachment. Skipping...'
|
|
|
|
|
);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
const attachment = message.attachments[0];
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
contentType: attachment.contentType,
|
|
|
|
@ -220,7 +226,7 @@ class SessionRightPanel extends React.Component<Props, State> {
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
media,
|
|
|
|
|
documents,
|
|
|
|
|
documents: _.compact(documents), // remove null
|
|
|
|
|
onItemClick,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|