diff --git a/Touchkebao/src/store/module/weChat/weChat.ts b/Touchkebao/src/store/module/weChat/weChat.ts index 91bc8a06..49515aca 100644 --- a/Touchkebao/src/store/module/weChat/weChat.ts +++ b/Touchkebao/src/store/module/weChat/weChat.ts @@ -150,22 +150,21 @@ export const useWeChatStore = create()( params.wechatChatroomId = contract.id; } - clearUnreadCount(params).then(() => { - if (isExist) { - updateChatSession({ - ...contract, - config: { unreadCount: 0 }, - }); - } else { - addChatSession(contract); - } - set({ currentContract: contract }); - updateConfig({ - id: contract.id, - config: { chat: true }, + clearUnreadCount(params); + if (isExist) { + updateChatSession({ + ...contract, + config: { unreadCount: 0 }, }); - state.loadChatMessages(true, 4704624000000); + } else { + addChatSession(contract); + } + set({ currentContract: contract }); + updateConfig({ + id: contract.id, + config: { chat: true }, }); + state.loadChatMessages(true, 4704624000000); }, // ==================== 消息加载方法 ====================