Browse Source

防止极端情况下消息串扰问题

master
xsx 9 months ago
parent
commit
faa3533306
  1. 4
      im-uniapp/pages/chat/chat-box.vue
  2. 5
      im-web/src/components/chat/ChatBox.vue

4
im-uniapp/pages/chat/chat-box.vue

@ -309,9 +309,11 @@ export default {
this.isReceipt = false; this.isReceipt = false;
// id // id
this.fillTargetId(msgInfo, this.chat.targetId); this.fillTargetId(msgInfo, this.chat.targetId);
//
const chat = this.chat;
this.sendMessageRequest(msgInfo).then((m) => { this.sendMessageRequest(msgInfo).then((m) => {
m.selfSend = true; m.selfSend = true;
this.chatStore.insertMessage(m, this.chat); this.chatStore.insertMessage(m, chat);
// //
this.moveChatToTop(); this.moveChatToTop();
}).finally(() => { }).finally(() => {

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

@ -456,13 +456,12 @@ export default {
msgInfo.receipt = this.isReceipt; msgInfo.receipt = this.isReceipt;
} }
this.lockMessage = true; this.lockMessage = true;
const chat = this.chat;
this.sendMessageRequest(msgInfo).then((m) => { this.sendMessageRequest(msgInfo).then((m) => {
m.selfSend = true; m.selfSend = true;
this.chatStore.insertMessage(m, this.chat); this.chatStore.insertMessage(m, chat);
//
this.moveChatToTop(); this.moveChatToTop();
}).finally(() => { }).finally(() => {
//
this.scrollToBottom(); this.scrollToBottom();
this.isReceipt = false; this.isReceipt = false;
resolve(); resolve();

Loading…
Cancel
Save