mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac
This commit is contained in:
@@ -12,7 +12,12 @@
|
||||
getAllUserChats,
|
||||
getChatList
|
||||
} from '$lib/apis/chats';
|
||||
import { getImportOrigin, convertOpenAIChats, disablePagination } from '$lib/utils';
|
||||
import {
|
||||
getImportOrigin,
|
||||
convertOpenAIChats,
|
||||
disablePagination,
|
||||
enablePagination
|
||||
} from '$lib/utils';
|
||||
import { onMount, getContext } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { toast } from 'svelte-sonner';
|
||||
@@ -61,8 +66,7 @@
|
||||
await createNewChat(localStorage.token, chat);
|
||||
}
|
||||
}
|
||||
disablePagination();
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
enablePagination();
|
||||
};
|
||||
|
||||
const exportChats = async () => {
|
||||
@@ -77,8 +81,7 @@
|
||||
await archiveAllChats(localStorage.token).catch((error) => {
|
||||
toast.error(error);
|
||||
});
|
||||
disablePagination();
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
enablePagination();
|
||||
};
|
||||
|
||||
const deleteAllChatsHandler = async () => {
|
||||
@@ -86,8 +89,8 @@
|
||||
await deleteAllChats(localStorage.token).catch((error) => {
|
||||
toast.error(error);
|
||||
});
|
||||
disablePagination();
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
|
||||
enablePagination();
|
||||
};
|
||||
|
||||
const toggleSaveChatHistory = async () => {
|
||||
|
||||
@@ -8,12 +8,13 @@
|
||||
getTagsById,
|
||||
updateChatById
|
||||
} from '$lib/apis/chats';
|
||||
import { tags as _tags, chats, pinnedChats, pageSkip, pageLimit, tagView } from '$lib/stores';
|
||||
import { tags as _tags, chats, pinnedChats, pageSkip, pageLimit } from '$lib/stores';
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
import Tags from '../common/Tags.svelte';
|
||||
import { enablePagination } from '$lib/utils';
|
||||
|
||||
export let chatId = '';
|
||||
let tags = [];
|
||||
@@ -59,7 +60,7 @@
|
||||
}
|
||||
} else {
|
||||
// if the tag we deleted is no longer a valid tag, return to main chat list view
|
||||
tagView.set(false);
|
||||
enablePagination();
|
||||
await chats.set(
|
||||
await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user