Commit 0e5692b2 by Sixong.Zhu

update

parent d3b91326
Showing with 19 additions and 17 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 = [];
await dispatch(ChatStore.ACTION_GET_CHAT_MEMBERS); try {
await Promise.all([ await dispatch(ChatStore.ACTION_GET_CHAT_MEMBERS);
dispatch(ChatStore.ACTION_REGISTER_EVENT), await Promise.all([
dispatch(ChatStore.ACTION_GET_CHAT_MESSAGES), dispatch(ChatStore.ACTION_REGISTER_EVENT),
]); dispatch(ChatStore.ACTION_GET_CHAT_MESSAGES),
commit( ]);
ChatStore.MUTATION_SAVE_CHAT_TITLE, } catch (e) {
wantedChatRoom.title || `会话${chatId}` Chat.error(e);
); } finally {
commit(ChatStore.MUTATION_INITING_CHAT_DONE); commit(
commit(ChatStore.MUTATION_SCROLL_TO_BOTTOM); ChatStore.MUTATION_SAVE_CHAT_TITLE,
(<any>state)[ChatStore.STATE_CHAT_CURRENT_IS_CHAT_ERROR] = null; wantedChatRoom.title || `在线咨询-${chatId}`
Chat.setRead(wantedChatRoom.model_name, wantedChatRoom.obj_id); );
commit(ChatStore.MUTATION_INITING_CHAT_DONE);
commit(ChatStore.MUTATION_SCROLL_TO_BOTTOM);
(<any>state)[ChatStore.STATE_CHAT_CURRENT_IS_CHAT_ERROR] = null;
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