From 7f50aeb0d382e152306a931a305c93133df4febd Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 6 Jun 2024 13:53:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=8Estore=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E4=BC=9A=E8=AF=9D=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/ConversationStore.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stores/ConversationStore.js b/src/stores/ConversationStore.js index f4472c1..96688d7 100644 --- a/src/stores/ConversationStore.js +++ b/src/stores/ConversationStore.js @@ -206,6 +206,7 @@ const conversationSlice = (set, get) => ({ const { conversationsList } = get(); const targetId = conversation.sn; const targetIndex = conversationsList.findIndex((ele) => String(ele.sn) === String(targetId)); + const targetItemFromList = conversationsList.find((ele) => String(ele.sn) === String(targetId)); targetIndex !== -1 ? conversationsList.splice(targetIndex, 1, { ...conversationsList[targetIndex], @@ -215,7 +216,7 @@ const conversationSlice = (set, get) => ({ return set((state) => ({ totalNotify: state.totalNotify - (conversation.unread_msg_count || 0), - currentConversation: conversation, + currentConversation: Object.assign({}, conversation, targetItemFromList), referenceMsg: {}, conversationsList: [...conversationsList], }));