Skip to content

Commit

Permalink
Show documents captions
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Jul 10, 2024
1 parent 4881cc3 commit 4115bf3
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions frontend/src/components/MessagesList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,9 @@ const MessagesList = ({ ticket, ticketId, isGroup }) => {

const checkMessageMedia = (message, messageData) => {
const data = JSON.parse(message.dataJson);
const document = data?.message?.documentMessage || data?.message?.documentWithCaptionMessage;
const document =
data?.message?.documentMessage
|| data?.message?.documentWithCaptionMessage?.message?.documentMessage;
if (!document && message.mediaType === "image") {
return (
<>
Expand Down Expand Up @@ -670,10 +672,21 @@ const MessagesList = ({ ticket, ticketId, isGroup }) => {
target="_blank"
href={message.mediaUrl}
>
🗎 {message.body}
🗎 { document?.fileName || message.body}
</Button>
</div>
<Divider />
{document?.caption && document.caption !== document?.fileName &&
<>
<Divider />
<div className={[clsx({
[classes.textContentItemDeleted]: message.isDeleted,
}),]}>
<MarkdownWrapper >
document.caption
</MarkdownWrapper>
</div>
</>
}
</>
);
}
Expand Down

0 comments on commit 4115bf3

Please sign in to comment.