|
|
@@ -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) {
|