From b13569a2ac6710e029c010abae55cc782abe3278 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Wed, 4 Dec 2024 11:16:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B6=88=E6=81=AF=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/channel/bubbleMsgUtils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/channel/bubbleMsgUtils.js b/src/channel/bubbleMsgUtils.js index 4d22f32..f54fa99 100644 --- a/src/channel/bubbleMsgUtils.js +++ b/src/channel/bubbleMsgUtils.js @@ -444,7 +444,7 @@ export const whatsappMsgTypeMapped = { }, text: { type: 'text', - data: (msg) => ({ id: msg.wamid, text: autoLinkText(msg?.text?.body), originText: msg?.text?.body, title: msg?.customerProfile?.name || msg?.from || '', idx: '--------------------------------------' }), + data: (msg) => ({ id: msg.wamid, text: autoLinkText(msg?.text?.body), originText: msg?.text?.body, title: msg?.customerProfile?.name || msg?.from || '', }), renderForReply: (msg) => ({ id: msg.wamid, message: msg?.text?.body }), }, image: { @@ -565,7 +565,7 @@ export const whatsappMsgTypeMapped = { id: msg.wamid, title: msg.document?.filename || '', text: msg.document?.caption || msg.document?.filename || '', - data: { uri: msg.document.link, status: { click: false, download: true, loading: 0 } }, + data: { uri: msg.document?.link, status: { click: false, download: true, loading: 0 } }, originText: msg.document?.caption || msg.document?.filename || '', }), renderForReply: (msg) => ({ @@ -725,6 +725,7 @@ export const parseRenderMessageList = (messages) => { msgOrigin: { ...msgContent, ...msgContent.email }, // id: msg.id || msgContent.wamid || msgContent.id, ...msgTypeData, + id: msgTypeData?.id || msg.sn, type: msgContent.type, ...(typeof whatsappMsgTypeMapped[msgType].type === 'function' ? whatsappMsgTypeMapped[msgType].type(msg) : { type: whatsappMsgTypeMapped[msgType].type || 'text' }), date: msg.msgtime, // msgContent?.sendTime || msg.msgtime || '', @@ -745,7 +746,7 @@ export const parseRenderMessageList = (messages) => { dateString: msgStatusRenderMapped[msgContent?.status || 'failed'] === 'failed' ? `${(msg.msgtime || '').replace('T', ' ')} 发送失败 ${waError} ❌` : '', statusCN: msgStatusRenderMappedCN[msgContent?.status || 'failed'], statusTitle: msgStatusRenderMappedCN[msgContent?.status || 'failed'], - id: (msgContent?.status || 'failed') === 'failed' ? msgContent.actionId : (msgTypeData.id || msg.id), + id: (msgContent?.status || 'failed') === 'failed' ? msgContent.actionId : (msgTypeData.id || msg.id || msg.sn), actionId: msgContent.actionId, replyButton: !['waiting', 'failed'].includes(msgContent?.status || 'failed') , }