This commit is contained in:
Timothy Jaeryang Baek 2026-08-16 23:32:23 -07:00
parent a40f6f2860
commit 736e38338e
2 changed files with 7 additions and 3 deletions

View file

@ -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);
}}

View file

@ -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?.()));
});