消息记录: 类型unsupported

dev/mobile
Lei OT 2 years ago
parent 76031d1aa5
commit 4620e331d2

@ -402,7 +402,7 @@ export const whatsappMsgTypeMapped = {
*/
export const parseRenderMessageItem = (msg) => {
console.log('parseRenderMessageItem', msg);
const thisMsgType = Object.keys(receivedMsgTypeMapped).includes(msg.type) ? msg.type : 'unsupported';
const thisMsgType = Object.keys(whatsappMsgTypeMapped).includes(msg.type) ? msg.type : 'unsupported';
return {
msgOrigin: msg,
date: msg?.sendTime || msg?.createTime || '',
@ -442,7 +442,7 @@ export const parseRenderMessageList = (messages, conversationid = null) => {
return messages.map((msg, i) => {
const msgContent = msg.msgtext_AsJOSN;
msgContent.template = msg.msgtype === 'template' ? { ...msgContent.template, ...msg.template_AsJOSN } : {};
const msgType = msgContent.type;
const msgType = Object.keys(whatsappMsgTypeMapped).includes(msgContent.type) ? msgContent.type : 'unsupported';
// const parseMethod = msgContent.bizType === 'whatsapp' ? cloneDeep(whatsappMsgTypeMapped) : {};
return {
msgOrigin: msgContent,
@ -468,8 +468,8 @@ export const parseRenderMessageList = (messages, conversationid = null) => {
reply: {
message: msg.messageorigin_AsJOSN?.text?.body || msg.messageorigin_AsJOSN?.text,
title: msg.messageorigin_AsJOSN?.customerProfile?.name || msg.messageorigin_AsJOSN?.senderName || 'me',
...(typeof whatsappMsgTypeMapped[msg.messageorigin_AsJOSN?.type]?.renderForReply === 'function'
? whatsappMsgTypeMapped[msg.messageorigin_AsJOSN?.type].renderForReply(msg.messageorigin_AsJOSN)
...(typeof whatsappMsgTypeMapped[(msg.messageorigin_AsJOSN?.type || 'unsupported')]?.renderForReply === 'function'
? whatsappMsgTypeMapped[(msg.messageorigin_AsJOSN?.type || 'unsupported')].renderForReply(msg.messageorigin_AsJOSN)
: {}),
// titleColor: msg.messageorigin_AsJOSN?.customerProfile?.name ? '#a791ff' : "#128c7e",
titleColor: msg.messageorigin_direction === 'inbound' ? '#a791ff' : "#128c7e",

Loading…
Cancel
Save