Browse Source

fix:1.图片无法撤回的bug 2.会话删除后无法重新打开的bug

master
xsx 2 years ago
parent
commit
977b6c829b
  1. 2
      im-uniapp/store/chatStore.js
  2. 4
      im-web/src/components/chat/ChatBox.vue
  3. 5
      im-web/src/store/chatStore.js

2
im-uniapp/store/chatStore.js

@ -335,6 +335,8 @@ export default defineStore('chatStore', {
chatKeys: chatKeys
}
uni.setStorageSync(key, chatsData)
// 清理已删除的会话
this.chats = this.chats.filter(chat => !chat.delete)
},
clear(state) {
cacheChats = [];

4
im-web/src/components/chat/ChatBox.vue

@ -156,9 +156,9 @@
let msgInfo = JSON.parse(JSON.stringify(file.msgInfo));
msgInfo.content = JSON.stringify(data);
msgInfo.receipt = this.isReceipt;
this.sendMessageRequest(msgInfo).then((id) => {
this.sendMessageRequest(msgInfo).then((m) => {
msgInfo.loadStatus = 'ok';
msgInfo.id = id;
msgInfo.id = m.id;
this.isReceipt = false;
this.$store.commit("insertMessage", msgInfo);
})

5
im-web/src/store/chatStore.js

@ -322,6 +322,8 @@ export default {
chatKeys: chatKeys
}
localForage.setItem(key, chatsData)
// 清理已删除的会话
state.chats = state.chats.filter(chat => !chat.delete)
},
clear(state) {
cacheChats = []
@ -337,8 +339,7 @@ export default {
localForage.getItem(key).then((chatsData) => {
if (!chatsData) {
resolve();
}
else if(chatsData.chats){
} else if (chatsData.chats) {
// 兼容旧版本
context.commit("initChats", chatsData);
resolve();

Loading…
Cancel
Save