mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-01 01:12:43 -05:00
perf: load sidebar folders alongside the chat list (#35242)
The sidebar only started loading folders after the chat list had arrived, so on every app load and chat list refresh the folders showed up one network round trip later than needed. The two requests do not depend on each other and now run at the same time, so the folder tree also refreshes when a newer chat list refresh replaces the current one.
This commit is contained in:
1 parent
e4ef437a8a
commit
ad372cd0e7
1 file changed
+4
-2
@@ -745,9 +745,11 @@
|
||||
|
||||
const refreshChatRows = async () => {
|
||||
markFolderChatsDirty();
|
||||
const result = await refreshChatList(localStorage.token, { refreshPinned: true });
|
||||
const [result] = await Promise.all([
|
||||
refreshChatList(localStorage.token, { refreshPinned: true }),
|
||||
initFolders()
|
||||
]);
|
||||
if (result.accepted) {
|
||||
await initFolders();
|
||||
await Promise.all(Object.values(folderRegistry).map((folder) => folder?.setFolderItems?.()));
|
||||
chatListReady = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user