refac
This commit is contained in:
@@ -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?.()));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user