Commit 9edeeeb6 by panjiangyi

优化打开会话逻辑

parent f24ba7b7
Showing with 2 additions and 16 deletions
......@@ -86,7 +86,6 @@
import { Component, Prop, Ref, Vue } from "vue-property-decorator";
import buttonThrottle from "../utils/button-throttle";
import { getChatModelInfo } from "../utils/chat-info";
import avatar from "@/customer-service/components/avatar.vue";
import { chatStore, ChatStore } from "@/customer-service/store/model";
......@@ -194,24 +193,10 @@ export default class ChatList extends Vue {
this.showChat();
return;
}
const wantedChatRoom = this.chatRooms.find(
(k) => k.chat_id === data.chat_id
);
if (wantedChatRoom == null) return;
if (wantedChatRoom.business_data == null) {
return;
}
const info = await getChatModelInfo(
wantedChatRoom.business_data.model_name,
wantedChatRoom.business_data.obj_id,
wantedChatRoom.business_data.detail_name
);
await this.saveChatId(wantedChatRoom.chat_id).finally(this.raiseChatIdChanged);
await this.saveChatId(data.chat_id).finally(this.raiseChatIdChanged);
this.showChat();
this.close();
this.saveChatTitle(info.uniplatId);
}
private raiseChatIdChanged() {
......
......@@ -505,6 +505,7 @@ export default {
dispatch(ChatStore.ACTION_GET_CHAT_MESSAGES),
dispatch(ChatStore.ACTION_GET_CHAT_MEMBERS),
]);
commit(ChatStore.MUTATION_SAVE_CHAT_TITLE, chatId);
commit(ChatStore.MUTATION_INITING_CHAT_DONE);
commit(ChatStore.MUTATION_SCROLL_TO_BOTTOM);
},
......
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