From d87a2315ce5fa151a3f91fbfec0fa3c245e40cfd Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 1 Oct 2025 21:56:37 -0500 Subject: [PATCH] refac --- src/lib/components/layout/Sidebar.svelte | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 0294bd8091..3cc9706ea3 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -182,7 +182,20 @@ currentChatPage.set(1); allChatsLoaded = false; - await chats.set(await getChatList(localStorage.token, $currentChatPage)); + initFolders(); + await Promise.all([ + await (async () => { + console.log('Init tags'); + const _tags = await getAllTags(localStorage.token); + tags.set(_tags); + })(), + await (async () => { + console.log('Init pinned chats'); + const _pinnedChats = await getPinnedChatList(localStorage.token); + pinnedChats.set(_pinnedChats); + })(), + await (async () => { + console.log('Init chat list'); const _chats = await getChatList(localStorage.token, $currentChatPage); await chats.set(_chats); })()