feat(接口更新): 將多個API請求從request轉為request2,並調整相關邏輯以支持新結構,優化代碼可讀性。同時,更新了聊天記錄的排序邏輯,根據未讀消息數量和時間進行排序,提升用戶體驗。
This commit is contained in:
@@ -141,7 +141,16 @@ export const useWeChatStore = create<WeChatState>()(
|
||||
const state = useWeChatStore.getState();
|
||||
// 切换联系人时清空当前消息,等待重新加载
|
||||
set({ currentMessages: [], openTransmitModal: false });
|
||||
clearUnreadCount([contract.id]).then(() => {
|
||||
|
||||
const params: any = {};
|
||||
|
||||
if (!contract.chatroomId) {
|
||||
params.wechatFriendId = contract.id;
|
||||
} else {
|
||||
params.wechatChatroomId = contract.id;
|
||||
}
|
||||
|
||||
clearUnreadCount(params).then(() => {
|
||||
if (isExist) {
|
||||
updateChatSession({
|
||||
...contract,
|
||||
|
||||
Reference in New Issue
Block a user