Commit 2b323c6f by Sixong.Zhu

u

parent 62ac38f4
Showing with 5 additions and 2 deletions
...@@ -548,9 +548,12 @@ export default { ...@@ -548,9 +548,12 @@ export default {
state[ChatStore.STATE_CURRENT_UNREAD_MESSAGE_COUNT] = sum; state[ChatStore.STATE_CURRENT_UNREAD_MESSAGE_COUNT] = sum;
}, },
async [ChatStore.ACTION_UPDATE_CHAT_UNREAD_MESSAGE_COUNT]( async [ChatStore.ACTION_UPDATE_CHAT_UNREAD_MESSAGE_COUNT](
{ dispatch }, { dispatch, state },
p: { chat: number; unread: number } p: { chat: number; unread: number }
) { ) {
const list = state[ChatStore.STATE_MY_CHAT_ROOM_LIST] as ChatType[];
const t = list.find(i => i.id === p.chat)
t && (t.unread_msg_count = p.unread)
return dbController return dbController
.updateChat4UnreadCount(p.chat, p.unread) .updateChat4UnreadCount(p.chat, p.unread)
.then(() => .then(() =>
...@@ -752,7 +755,7 @@ export default { ...@@ -752,7 +755,7 @@ export default {
}; };
if (e.type === MessageType.Withdraw) { if (e.type === MessageType.Withdraw) {
dbController dbController
.removeMessage(e.chat_id, [+e.msg]) .removeMessage(e.chat_id, e.msg.startsWith('[') ? JSON.parse(e.msg) : [+e.msg])
.finally(() => thenAction()); .finally(() => thenAction());
} else { } else {
thenAction(); thenAction();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment