Commit 0e5692b2 by Sixong.Zhu

update

parent d3b91326
Showing with 7 additions and 5 deletions
...@@ -780,10 +780,7 @@ export default { ...@@ -780,10 +780,7 @@ export default {
}; };
if (e.type === MessageType.Withdraw) { if (e.type === MessageType.Withdraw) {
dbController dbController
.removeMessage( .removeMessage(e.chat_id, xim.withDrawMsgHandle(e))
e.chat_id,
xim.withDrawMsgHandle(e)
)
.finally(() => thenAction()); .finally(() => thenAction());
} else { } else {
thenAction(); thenAction();
...@@ -903,19 +900,24 @@ export default { ...@@ -903,19 +900,24 @@ export default {
commit(ChatStore.MUTATION_INITING_CHAT); commit(ChatStore.MUTATION_INITING_CHAT);
removeRegisterChatEvents.forEach((k) => k()); removeRegisterChatEvents.forEach((k) => k());
removeRegisterChatEvents = []; removeRegisterChatEvents = [];
try {
await dispatch(ChatStore.ACTION_GET_CHAT_MEMBERS); await dispatch(ChatStore.ACTION_GET_CHAT_MEMBERS);
await Promise.all([ await Promise.all([
dispatch(ChatStore.ACTION_REGISTER_EVENT), dispatch(ChatStore.ACTION_REGISTER_EVENT),
dispatch(ChatStore.ACTION_GET_CHAT_MESSAGES), dispatch(ChatStore.ACTION_GET_CHAT_MESSAGES),
]); ]);
} catch (e) {
Chat.error(e);
} finally {
commit( commit(
ChatStore.MUTATION_SAVE_CHAT_TITLE, ChatStore.MUTATION_SAVE_CHAT_TITLE,
wantedChatRoom.title || `会话${chatId}` wantedChatRoom.title || `在线咨询-${chatId}`
); );
commit(ChatStore.MUTATION_INITING_CHAT_DONE); commit(ChatStore.MUTATION_INITING_CHAT_DONE);
commit(ChatStore.MUTATION_SCROLL_TO_BOTTOM); commit(ChatStore.MUTATION_SCROLL_TO_BOTTOM);
(<any>state)[ChatStore.STATE_CHAT_CURRENT_IS_CHAT_ERROR] = null; (<any>state)[ChatStore.STATE_CHAT_CURRENT_IS_CHAT_ERROR] = null;
Chat.setRead(wantedChatRoom.model_name, wantedChatRoom.obj_id); Chat.setRead(wantedChatRoom.model_name, wantedChatRoom.obj_id);
}
}, },
async [ChatStore.ACTION_CLEAR_CURRENT_CHAT_DATA]({ commit, state }) { async [ChatStore.ACTION_CLEAR_CURRENT_CHAT_DATA]({ commit, state }) {
commit(ChatStore.MUTATION_CLEAR_CURRENT_CHAT_ID); commit(ChatStore.MUTATION_CLEAR_CURRENT_CHAT_ID);
......
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