perf(WAI): update事件的 from to 不要覆盖

main
Lei OT 6 months ago
parent 8503e85b72
commit 278e420483

@ -239,8 +239,8 @@ const setupMessageHandler = async () => {
// const ifUpsertMsgOrigin = !isEmpty(omitEmpty(waiContentFieldsToDB)) || isEmpty(savedMsg); // const ifUpsertMsgOrigin = !isEmpty(omitEmpty(waiContentFieldsToDB)) || isEmpty(savedMsg);
// const msgOrigin = ifUpsertMsgOrigin ? { message_origin: JSON.stringify(messageData) } : {}; // const msgOrigin = ifUpsertMsgOrigin ? { message_origin: JSON.stringify(messageData) } : {};
// 合并数据原文 // 合并数据原文
const { from, to, ..._extraMessage } = messageData; const { from: _from, to: _to, ..._extraMessage } = messageData;
const _forNoSaved = `{"to": "${to}","from": "${from}"}`; const _forNoSaved = `{"to": "${_to}","from": "${_from}"}`;
const msgOriginObj = Object.assign({}, JSON.parse(savedMsg?.message_origin || _forNoSaved), _extraMessage); const msgOriginObj = Object.assign({}, JSON.parse(savedMsg?.message_origin || _forNoSaved), _extraMessage);
const msgOrigin = { message_origin: JSON.stringify(msgOriginObj) }; const msgOrigin = { message_origin: JSON.stringify(msgOriginObj) };

Loading…
Cancel
Save