From 2bcb1e2de8647032dddc69b1506deb2b8a138b70 Mon Sep 17 00:00:00 2001 From: blue <825657193@qq.com> Date: Thu, 25 Apr 2024 23:13:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=9A=E8=AF=9D=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E7=BF=BB=E5=80=8D=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im-uniapp/store/chatStore.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/im-uniapp/store/chatStore.js b/im-uniapp/store/chatStore.js index 2e1ff9d..75950af 100644 --- a/im-uniapp/store/chatStore.js +++ b/im-uniapp/store/chatStore.js @@ -27,6 +27,7 @@ export default { mutations: { initChats(state, chatsData) { cacheChats = []; + state.chats = []; for (let chat of chatsData.chats) { // 已删除的会话直接丢弃 if (chat.delete) { @@ -50,7 +51,7 @@ export default { } }) }) - + console.log(cacheChats.length) }, openChat(state, chatInfo) { let chats = this.getters.findChats(); @@ -294,6 +295,7 @@ export default { }); // 将消息一次性装载回来 state.chats = cacheChats; + console.log(cacheChats.length) this.commit("saveToStorage"); }, saveToStorage(state) {