fix(ui): run initChatList API calls concurrently in Promise.all (#25838)
This commit is contained in:
1 file changed
+4
-4
@@ -324,17 +324,17 @@
|
|||||||
initFolders();
|
initFolders();
|
||||||
initSharedFolders();
|
initSharedFolders();
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
await (async () => {
|
(async () => {
|
||||||
console.log('Init tags');
|
console.log('Init tags');
|
||||||
const _tags = await getAllTags(localStorage.token);
|
const _tags = await getAllTags(localStorage.token);
|
||||||
tags.set(_tags);
|
tags.set(_tags);
|
||||||
})(),
|
})(),
|
||||||
await (async () => {
|
(async () => {
|
||||||
console.log('Init pinned chats');
|
console.log('Init pinned chats');
|
||||||
const _pinnedChats = await getPinnedChatList(localStorage.token);
|
const _pinnedChats = await getPinnedChatList(localStorage.token);
|
||||||
pinnedChats.set(_pinnedChats);
|
pinnedChats.set(_pinnedChats);
|
||||||
})(),
|
})(),
|
||||||
await (async () => {
|
(async () => {
|
||||||
if (
|
if (
|
||||||
$config?.features?.enable_notes &&
|
$config?.features?.enable_notes &&
|
||||||
($user?.role === 'admin' || ($user?.permissions?.features?.notes ?? true))
|
($user?.role === 'admin' || ($user?.permissions?.features?.notes ?? true))
|
||||||
@@ -344,7 +344,7 @@
|
|||||||
pinnedNotes.set(_pinnedNotes);
|
pinnedNotes.set(_pinnedNotes);
|
||||||
}
|
}
|
||||||
})(),
|
})(),
|
||||||
await (async () => {
|
(async () => {
|
||||||
console.log('Init chat list');
|
console.log('Init chat list');
|
||||||
const _chats = await getChatList(localStorage.token, $currentChatPage);
|
const _chats = await getChatList(localStorage.token, $currentChatPage);
|
||||||
await chats.set(_chats);
|
await chats.set(_chats);
|
||||||
|
|||||||
Reference in new issue
Block a user