Commit 19f15b59 by 杨铁龙

fix:发送消息控制台报错

parent 360546b1
Showing with 5 additions and 3 deletions
...@@ -40,7 +40,10 @@ function filterMessages( ...@@ -40,7 +40,10 @@ function filterMessages(
const removeRegisterChatEvents: (() => void)[] = []; const removeRegisterChatEvents: (() => void)[] = [];
async function preCacheImgs(msgs: any[]) { async function preCacheImgs(msgs?: any[]) {
if (!msgs) {
return Promise.resolve();
}
await Promise.all( await Promise.all(
msgs.map((k) => { msgs.map((k) => {
return new Promise((resolve: (p: void) => void) => { return new Promise((resolve: (p: void) => void) => {
...@@ -320,11 +323,10 @@ export default { ...@@ -320,11 +323,10 @@ export default {
async [ChatStore.ACTION_GET_MY_CHAT_LIST]({ async [ChatStore.ACTION_GET_MY_CHAT_LIST]({
state, state,
commit, commit,
}) /* ...params: Parameters<ChatStore.ACTION_GET_MY_CHAT_LIST> */ { }) {
const data = await xim.fetchChatList(); const data = await xim.fetchChatList();
if (data == null) return; if (data == null) return;
const chatList = data.args[0]; const chatList = data.args[0];
console.log("chatList:", chatList);
commit(ChatStore.MUTATION_SAVE_CHAT_LIST, { commit(ChatStore.MUTATION_SAVE_CHAT_LIST, {
list: chatList.map((chat: any) => { list: chatList.map((chat: any) => {
let business_data; let business_data;
......
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