Browse Source

fix: 消息可能一直发送中的bug

master
xsx 6 months ago
parent
commit
fe83940be0
  1. 8
      im-uniapp/store/chatStore.js
  2. 4
      im-web/src/store/chatStore.js

8
im-uniapp/store/chatStore.js

@ -523,6 +523,14 @@ export default defineStore('chatStore', {
if (msgInfo.tmpId) {
for (let idx = chat.messages.length - 1; idx >= 0; idx--) {
let m = chat.messages[idx];
// 这里只查询临时消息,跳过正常消息
if (m.id) {
continue;
}
// 这里只查询临时消息,跳过有id的正常消息
if (m.id) {
contine;
}
if (m.tmpId && msgInfo.tmpId == m.tmpId) {
return m;
}

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

@ -551,6 +551,10 @@ export default defineStore('chatStore', {
if (msgInfo.tmpId) {
for (let idx = chat.messages.length - 1; idx >= 0; idx--) {
let m = chat.messages[idx];
// 这里只查询临时消息,跳过正常消息
if (m.id) {
continue;
}
if (m.tmpId && msgInfo.tmpId == m.tmpId) {
return m;
}

Loading…
Cancel
Save