fix(MessageList): 修复从store获取chatSessions的方式

使用getChatSessions方法替代直接访问chatSessions状态,确保获取的是最新数据
This commit is contained in:
超级老白兔
2025-09-05 15:22:26 +08:00
parent f76029c2d9
commit afa58712cf

View File

@@ -11,7 +11,7 @@ interface MessageListProps {}
const MessageList: React.FC<MessageListProps> = () => { const MessageList: React.FC<MessageListProps> = () => {
const { setCurrentContact, currentContract } = useWeChatStore(); const { setCurrentContact, currentContract } = useWeChatStore();
const chatSessions = useCkChatStore(state => state.chatSessions); const chatSessions = useCkChatStore(state => state.getChatSessions());
const onContactClick = (session: ContractData | weChatGroup) => { const onContactClick = (session: ContractData | weChatGroup) => {
setCurrentContact(session, true); setCurrentContact(session, true);
}; };