Commit ff7ed205 by panjiangyi

修复ts报错

parent 168aeeff
Showing with 5 additions and 3 deletions
......@@ -288,10 +288,11 @@ export default {
commit,
}) /* ...params: Parameters<ChatStore.ACTION_GET_MY_CHAT_LIST> */ {
const data = await xim.fetchChatList();
if (data == null) return
const chatList = data.args[0];
console.log("testing", chatList);
commit(ChatStore.MUTATION_SAVE_CHAT_LIST, {
list: chatList.map((chat) => {
list: chatList.map((chat: any) => {
let business_data;
if (chat.business_data) {
business_data = JSON.parse(chat.business_data);
......@@ -408,7 +409,7 @@ export default {
{ state, commit, dispatch },
params: Parameters<ChatStore.ACTION_CREATE_NEW_CHAT_BY_SERVICE_MAN>[0]
) {
const { id } = await sdk().model(params.modelName).createChat({
const { id } = await sdk().model(params.modelName).createChat({
detailId: +params.selectedListId
});
await new Promise(resolve => setTimeout(resolve, 500));
......@@ -557,6 +558,7 @@ export default {
.execute();
await dispatch(ChatStore.ACTION_GET_MY_CHAT_LIST);
const firstChat = state[ChatStore.STATE_MY_CHAT_ROOM_LIST]?.list[0];
if (firstChat == null) return
const chatInfo = await getChatModelInfo(firstChat.business_data.model_name, firstChat.business_data.obj_id);
await dispatch(ChatStore.ACTION_SAVE_CURRENT_CHAT_ID_VERSION, {
chatId: firstChat.chat_id,
......@@ -616,7 +618,7 @@ export default {
},
[ChatStore.GETTER_CURRENT_CURRENT_CHAT](state) {
const chatId = state[ChatStore.STATE_CHAT_CURRENT_CHAT_ID];
const chatList = state[ChatStore.STATE_MY_CHAT_ROOM_LIST].list;
const chatList = state[ChatStore.STATE_MY_CHAT_ROOM_LIST]?.list ?? [];
return chatList.find(chat => chat.chat_id === chatId);
},
},
......
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