mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
feat: archive chat
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
getChatById,
|
||||
getChatListByTagName,
|
||||
updateChatById,
|
||||
getAllChatTags
|
||||
getAllChatTags,
|
||||
archiveChatById
|
||||
} from '$lib/apis/chats';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { fade, slide } from 'svelte/transition';
|
||||
@@ -139,6 +140,11 @@
|
||||
localStorage.setItem('settings', JSON.stringify($settings));
|
||||
location.href = '/';
|
||||
};
|
||||
|
||||
const archiveChatHandler = async (id) => {
|
||||
await archiveChatById(localStorage.token, id);
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
};
|
||||
</script>
|
||||
|
||||
<ShareChatModal bind:show={showShareChatModal} chatId={shareChatId} />
|
||||
@@ -594,7 +600,7 @@
|
||||
aria-label="Archive"
|
||||
class=" self-center dark:hover:text-white transition"
|
||||
on:click={() => {
|
||||
selectedChatId = chat.id;
|
||||
archiveChatHandler(chat.id);
|
||||
}}
|
||||
>
|
||||
<ArchiveBox />
|
||||
|
||||
Reference in New Issue
Block a user