Commit 0e5692b2 by Sixong.Zhu

update

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