diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index adfe074fd5..1c5108d0b3 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -4209,12 +4209,12 @@ const archiveChatHandler = async (id: string) => { try { - await archiveChatById(localStorage.token, id); + const res = await archiveChatById(localStorage.token, id); initNewChat(); await goto('/'); await refreshChatList(localStorage.token, { refreshPinned: true }); await refreshFolderChatLists(); - toast.success($i18n.t('Chat archived.')); + toast.success(res?.archived ? $i18n.t('Chat archived.') : $i18n.t('Chat unarchived.')); } catch (error) { console.error('Error archiving chat:', error); toast.error($i18n.t('Failed to archive chat.')); @@ -4422,6 +4422,7 @@ {readOnly} chat={{ id: $chatId, + archived: chat?.archived ?? false, chat: { title: $chatTitle, models: selectedModels, diff --git a/src/lib/components/layout/Navbar/Menu.svelte b/src/lib/components/layout/Navbar/Menu.svelte index 5034155126..cd3b1f5f37 100644 --- a/src/lib/components/layout/Navbar/Menu.svelte +++ b/src/lib/components/layout/Navbar/Menu.svelte @@ -484,7 +484,9 @@ }} > -
{$i18n.t('Archive')}
+
+ {chat?.archived ? $i18n.t('Unarchive') : $i18n.t('Archive')} +
{#if $user?.role === 'admin' || ($user?.permissions?.chat?.delete ?? true)}