From afa58712cffd82506cb46fd08b7d0be7a8d7b221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=80=81=E7=99=BD=E5=85=94?= Date: Fri, 5 Sep 2025 15:22:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(MessageList):=20=E4=BF=AE=E5=A4=8D=E4=BB=8E?= =?UTF-8?q?store=E8=8E=B7=E5=8F=96chatSessions=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用getChatSessions方法替代直接访问chatSessions状态,确保获取的是最新数据 --- .../pages/pc/ckbox/components/SidebarMenu/MessageList/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cunkebao/src/pages/pc/ckbox/components/SidebarMenu/MessageList/index.tsx b/Cunkebao/src/pages/pc/ckbox/components/SidebarMenu/MessageList/index.tsx index f0ea752c..14c68a3d 100644 --- a/Cunkebao/src/pages/pc/ckbox/components/SidebarMenu/MessageList/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/components/SidebarMenu/MessageList/index.tsx @@ -11,7 +11,7 @@ interface MessageListProps {} const MessageList: React.FC = () => { const { setCurrentContact, currentContract } = useWeChatStore(); - const chatSessions = useCkChatStore(state => state.chatSessions); + const chatSessions = useCkChatStore(state => state.getChatSessions()); const onContactClick = (session: ContractData | weChatGroup) => { setCurrentContact(session, true); };