fix(MessageList): 修复从store获取chatSessions的方式
使用getChatSessions方法替代直接访问chatSessions状态,确保获取的是最新数据
This commit is contained in:
@@ -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);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user