Skip to content

Commit 5190bdc

Browse files
[Chat] Render Non ACS images without the onClick function (#4214)
1 parent 9f55109 commit 5190bdc

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "minor",
3+
"area": "improvement",
4+
"workstream": "InlineImage",
5+
"comment": "In the chat composite, if the message contains image that's not an ACS image, we will render the image but it will not be clickable to view and download in the ImageOverlay",
6+
"packageName": "@azure/communication-react",
7+
"email": "107075081+Leah-Xia-Microsoft@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "minor",
3+
"area": "improvement",
4+
"workstream": "InlineImage",
5+
"comment": "In the chat composite, if the message contains image that's not an ACS image, we will render the image but it will not be clickable to view and download in the ImageOverlay",
6+
"packageName": "@azure/communication-react",
7+
"email": "107075081+Leah-Xia-Microsoft@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}

packages/react-composites/src/composites/ChatComposite/ChatScreen.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,15 @@ export const ChatScreen = (props: ChatScreenProps): JSX.Element => {
309309
inlineImage: InlineImage,
310310
defaultOnRender: (inlineImage: InlineImage) => JSX.Element
311311
): JSX.Element => {
312+
const message = adapter.getState().thread.chatMessages[inlineImage.messageId];
313+
const attachments = message?.content?.attachments?.find(
314+
(attachment) => attachment.id === inlineImage.imgAttrs.id
315+
);
316+
317+
if (attachments === undefined) {
318+
return defaultOnRender(inlineImage);
319+
}
320+
312321
return (
313322
<span
314323
key={inlineImage.imgAttrs.id}

0 commit comments

Comments
 (0)