Merge branch 'release' into staging
This commit is contained in:
commit
d861c59f27
|
@ -5145,7 +5145,8 @@ export async function getChatsFromFiles(data, isGroupChat) {
|
|||
let chat_dict = {};
|
||||
let chat_list = Object.values(data).sort((a, b) => a["file_name"].localeCompare(b["file_name"])).reverse();
|
||||
|
||||
for (const { file_name } of chat_list) {
|
||||
let chat_promise = chat_list.map(({ file_name}) => {
|
||||
return new Promise(async (res, rej) => {
|
||||
try {
|
||||
const endpoint = isGroupChat ? '/getgroupchat' : '/getchat';
|
||||
const requestBody = isGroupChat
|
||||
|
@ -5164,7 +5165,8 @@ export async function getChatsFromFiles(data, isGroupChat) {
|
|||
});
|
||||
|
||||
if (!chatResponse.ok) {
|
||||
continue;
|
||||
return res();
|
||||
// continue;
|
||||
}
|
||||
|
||||
const currentChat = await chatResponse.json();
|
||||
|
@ -5177,7 +5179,12 @@ export async function getChatsFromFiles(data, isGroupChat) {
|
|||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
return res();
|
||||
})
|
||||
})
|
||||
|
||||
await Promise.all(chat_promise)
|
||||
|
||||
return chat_dict;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue