mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-28 05:27:35 +00:00
refac
This commit is contained in:
parent
a40f6f2860
commit
736e38338e
2 changed files with 7 additions and 3 deletions
|
|
@ -113,10 +113,10 @@
|
|||
folder={$selectedFolder}
|
||||
readOnly={folderReadOnly}
|
||||
onUpdate={async () => {
|
||||
await Promise.all([refreshChatList(localStorage.token), refreshFolderChatLists()]);
|
||||
await Promise.all([refreshChatList(localStorage.token), refreshFolderChatLists(null)]);
|
||||
}}
|
||||
onDelete={async () => {
|
||||
await Promise.all([refreshChatList(localStorage.token), refreshFolderChatLists()]);
|
||||
await Promise.all([refreshChatList(localStorage.token), refreshFolderChatLists(null)]);
|
||||
|
||||
selectedFolder.set(null);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -702,6 +702,11 @@
|
|||
socketInstance?.on('connect', refreshChatRows);
|
||||
|
||||
const unregisterFolderRefreshHandler = registerFolderRefreshHandler(async (folderId, chat) => {
|
||||
// null refreshes the folder tree; undefined refreshes all folder chat lists.
|
||||
if (folderId === null) {
|
||||
return initFolders();
|
||||
}
|
||||
|
||||
if (folderId) {
|
||||
if (chat) {
|
||||
return folderRegistry[folderId]?.upsertChat?.(chat);
|
||||
|
|
@ -710,7 +715,6 @@
|
|||
return folderRegistry[folderId]?.setFolderItems?.();
|
||||
}
|
||||
|
||||
await initFolders();
|
||||
return Promise.all(Object.values(folderRegistry).map((folder) => folder?.setFolderItems?.()));
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue