fix: unarchive chats moved into folders and refresh sidebar folders after menu moves (#27485)

This commit is contained in:
G30
2026-07-26 18:43:34 -04:00
committed by GitHub
parent 71f8b6d5b4
commit db92ef292f
4 changed files with 38 additions and 2 deletions
+3 -1
View File
@@ -48,7 +48,7 @@
chatRequestQueues,
desktopEvent
} from '$lib/stores';
import { refreshChatList } from '$lib/stores/chatList';
import { refreshChatList, refreshFolderChatLists } from '$lib/stores/chatList';
import { WEBUI_API_BASE_URL } from '$lib/constants';
@@ -3566,6 +3566,7 @@
if (res) {
await refreshChatList(localStorage.token, { refreshPinned: true });
await refreshFolderChatLists();
toast.success($i18n.t('Chat moved successfully'));
}
@@ -3580,6 +3581,7 @@
initNewChat();
await goto('/');
await refreshChatList(localStorage.token, { refreshPinned: true });
await refreshFolderChatLists();
toast.success($i18n.t('Chat archived.'));
} catch (error) {
console.error('Error archiving chat:', error);
+12 -1
View File
@@ -27,7 +27,12 @@
WEBUI_NAME,
sidebarWidth
} from '$lib/stores';
import { loadNextChatListPage, refreshChatList, setChatActive } from '$lib/stores/chatList';
import {
loadNextChatListPage,
refreshChatList,
registerFolderRefreshHandler,
setChatActive
} from '$lib/stores/chatList';
import { onMount, getContext, tick, onDestroy } from 'svelte';
const i18n = getContext('i18n');
@@ -649,6 +654,10 @@
socketInstance?.on('events', chatActiveEventHandler);
socketInstance?.on('connect', refreshChatRows);
const unregisterFolderRefreshHandler = registerFolderRefreshHandler(() =>
Promise.all(Object.values(folderRegistry).map((folder) => folder?.setFolderItems?.()))
);
await tick();
initPinnedMenuSortable();
@@ -672,6 +681,8 @@
socketInstance?.off('events', chatActiveEventHandler);
socketInstance?.off('connect', refreshChatRows);
unregisterFolderRefreshHandler();
};
});