|
|
|
@ -345,9 +345,12 @@ const messageSlice = (set, get) => ({
|
|
|
|
|
const targetMsgs = (activeConversations[String(targetId)] || []).map((ele) => {
|
|
|
|
|
// 更新状态
|
|
|
|
|
// * 已读的不再更新状态, 有时候投递结果在已读之后返回
|
|
|
|
|
if (ele.id === ele.actionId && ele.actionId === message.actionId) {
|
|
|
|
|
// if (ele.id === ele.actionId && ele.actionId === message.actionId) {
|
|
|
|
|
if (ele.actionId === message.actionId) {
|
|
|
|
|
// WABA: 同步返回, 根据actionId 更新消息的id
|
|
|
|
|
return { ...ele, id: message.id, status: ele.status === 'read' ? ele.status : message.status, dateString: message.dateString };
|
|
|
|
|
} else if (String(ele.id) === String(message.id)) {
|
|
|
|
|
// WABA: 异步的后续状态更新, id已更新为wamid
|
|
|
|
|
// console.log('old msg ele', ele);
|
|
|
|
|
const renderStatus = message?.data?.status ? { status: { ...ele.data.status, loading: 0, download: true } } : {};
|
|
|
|
|
const keepReply = ele.reply ? { reply: ele.reply } : {};
|
|
|
|
|