From 6b40736ef52d7ad07209cdfc0466840f036dbc30 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 21 Feb 2025 13:47:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=89=8D=E7=AB=AF):=20=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E4=BC=9A=E8=AF=9D=E7=9A=84=E8=81=94=E7=B3=BB?= =?UTF-8?q?=E4=BA=BA=E4=BF=A1=E6=81=AF,=20=E6=9B=B4=E6=96=B0=E4=BC=9A?= =?UTF-8?q?=E8=AF=9D=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useConversation.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hooks/useConversation.js b/src/hooks/useConversation.js index 6981bdb..39d3dc7 100644 --- a/src/hooks/useConversation.js +++ b/src/hooks/useConversation.js @@ -36,6 +36,7 @@ export function useConversationNewItem() { state.setCurrentConversation, state.updateConversationItem, ]); + const updateCurrentConversation = useConversationStore((state) => state.updateCurrentConversation); const conversationsList = useConversationStore((state) => state.conversationsList); const addToConversationList = useConversationStore((state) => state.addToConversationList); const userId = useAuthStore((state) => state.loginUser.userId); @@ -93,7 +94,7 @@ export function useConversationNewItem() { phone_number: createdNew.guest_phone, whatsapp_phone_number: createdNew.whatsapp_phone_number, }, - conversation_memo: createdNew.remark, + conversation_memo: createdNew.guest_name || createdNew.remark, // lasttime: createdNew.session_creatime, show_default: createdNew.remark || createdNew.guest_name || createdNew.guest_phone || createdNew.guest_email || createdNew.whatsapp_phone_number || '', } @@ -117,7 +118,11 @@ export function useConversationNewItem() { // }) return ; } - updateConversationItem(buildChatItem); + if (currentConversation.sn === createdNew.conversationid) { + updateCurrentConversation(buildChatItem); + } else { + updateConversationItem(buildChatItem); + } };