test: 新消息: 更新会话列表: 修改判断; console

hotfix/new-conversation
Lei OT 1 year ago
parent ede92014c1
commit eb5b2a06de

@ -334,6 +334,7 @@ const messageSlice = (set, get) => ({
conversationsList.unshift(newConversation);
console.log('find in list, i:', targetIndex);
console.log('find in list, chat updated and Top: \n', JSON.stringify(newConversation, null, 2));
console.log('list updated : \n', JSON.stringify(conversationsList, null, 2));
const isCurrent = Number(targetId) === Number(currentConversation.sn);
const updatedCurrent = isCurrent
? {
@ -342,9 +343,6 @@ const messageSlice = (set, get) => ({
conversation_expiretime: dayjs(message.date).add(24, 'hours').format(DATETIME_FORMAT),
}
: {...currentConversation};
// const currentI = conversationsList.findIndex((ele) => String(ele.sn) === String(currentConversation.sn));
console.log('message in chat', JSON.stringify(message, null, 2), 'currentConversation', JSON.stringify(currentConversation, null, 2));
console.log('is current and update', isCurrent, JSON.stringify(updatedCurrent, null, 2));
return set({
currentConversation: updatedCurrent,
conversationsList: [...conversationsList],

Loading…
Cancel
Save