From 015c31f3da7ccd84ba0a84a5a333ac8ef83aa5d9 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 30 May 2024 17:04:47 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=9B=BE=E7=89=87=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/channel/whatsappUtils.js | 6 +++++- src/views/Conversations/Online/MessagesWrapper.jsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/channel/whatsappUtils.js b/src/channel/whatsappUtils.js index 6684b59..f74fde0 100644 --- a/src/channel/whatsappUtils.js +++ b/src/channel/whatsappUtils.js @@ -327,12 +327,16 @@ export const whatsappMsgTypeMapped = { data: (msg) => ({ id: msg.wamid, text: msg.image.caption, + onPhotoError: ({ currentTarget }) => { + currentTarget.onerror = null; + currentTarget.src="https://hiana-crm.oss-accelerate.aliyuncs.com/WAMedia/afe412d4-3acf-4e79-a623-048aeb4d696a.png"; + }, data: { id: msg.wamid, uri: msg.image.link, width: 'auto', height: 200, - alt: msg.image.caption, + alt: msg.image.caption || '', status: { click: true, loading: 0, diff --git a/src/views/Conversations/Online/MessagesWrapper.jsx b/src/views/Conversations/Online/MessagesWrapper.jsx index 2821d6d..bb5fe4f 100644 --- a/src/views/Conversations/Online/MessagesWrapper.jsx +++ b/src/views/Conversations/Online/MessagesWrapper.jsx @@ -140,7 +140,7 @@ const MessagesWrapper = ({ updateRead = true, forceGetMessages }) => { longListLoading, setLongListLoading, getMoreMessages, loadNextPage: currentConversation?.loadNextPage ?? true }} /> - + setContactsModalVisible(false)} footer={null} > {contactListData.map((contact) => (