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
48a5696042
commit
3c010951db
1 changed files with 17 additions and 11 deletions
|
|
@ -403,6 +403,18 @@
|
|||
]);
|
||||
};
|
||||
|
||||
const initSidebarData = async () => {
|
||||
// Only fetch channels if the feature is enabled and user has permission
|
||||
if (
|
||||
$config?.features?.enable_channels &&
|
||||
($user?.role === 'admin' || ($user?.permissions?.features?.channels ?? true))
|
||||
) {
|
||||
await initChannels();
|
||||
}
|
||||
|
||||
await initChatList();
|
||||
};
|
||||
|
||||
const refreshChatRows = async () => {
|
||||
const result = await refreshChatList(localStorage.token, { refreshPinned: true });
|
||||
if (result.accepted) {
|
||||
|
|
@ -414,6 +426,10 @@
|
|||
};
|
||||
|
||||
const loadMoreChats = async () => {
|
||||
if (chatListLoading || allChatsLoaded || !$showSidebar) {
|
||||
return;
|
||||
}
|
||||
|
||||
chatListLoading = true;
|
||||
|
||||
const result = await loadNextChatListPage(localStorage.token);
|
||||
|
|
@ -661,17 +677,6 @@
|
|||
navElement.style['-webkit-app-region'] = 'drag';
|
||||
}
|
||||
}
|
||||
|
||||
if (value) {
|
||||
// Only fetch channels if the feature is enabled and user has permission
|
||||
if (
|
||||
$config?.features?.enable_channels &&
|
||||
($user?.role === 'admin' || ($user?.permissions?.features?.channels ?? true))
|
||||
) {
|
||||
await initChannels();
|
||||
}
|
||||
await initChatList();
|
||||
}
|
||||
}),
|
||||
settings.subscribe((value) => {
|
||||
if (pinnedModels != value?.pinnedModels ?? []) {
|
||||
|
|
@ -711,6 +716,7 @@
|
|||
});
|
||||
|
||||
await tick();
|
||||
await initSidebarData();
|
||||
initPinnedMenuSortable();
|
||||
|
||||
return () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue