perf: 图片加载失败的提示

hotfix/new-conversation
Lei OT 1 year ago
parent 5185b0ae73
commit 015c31f3da

@ -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,

@ -140,7 +140,7 @@ const MessagesWrapper = ({ updateRead = true, forceGetMessages }) => {
longListLoading, setLongListLoading, getMoreMessages, loadNextPage: currentConversation?.loadNextPage ?? true
}}
/>
<Image width={0} height={0} src={null} preview={{ visible: previewVisible, src: previewSrc, onClose: onPreviewClose }} />
<Image width={0} height={0} src={null} preview={{ visible: previewVisible, src: previewSrc, onClose: onPreviewClose, fallback: 'https://hiana-crm.oss-accelerate.aliyuncs.com/WAMedia/afe412d4-3acf-4e79-a623-048aeb4d696a.png' }} />
<Modal title="联系人" closable open={contactsModalVisible} onOk={handleContactItemClick} onCancel={() => setContactsModalVisible(false)} footer={null} >
{contactListData.map((contact) => (
<Button onClick={() => handleContactItemClick(contact)} type='link' key={contact.id}>{contact.name}: <span>{contact.wa_id}</span></Button>

Loading…
Cancel
Save