mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-07 02:58:21 +00:00
- Pass `archived` state from active chat model to Navbar context menu - Render 'Unarchive' instead of 'Archive' when `chat?.archived` is true in Navbar/Menu.svelte - Dynamically display 'Chat unarchived.' toast upon unarchiving in archiveChatHandler - Closes #31473 Co-authored-by: PINYO PATTANAWASANPORN <pattanawasanporn@gmail.com>
This commit is contained in:
parent
88720c6928
commit
ce94c41d81
2 changed files with 6 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -484,7 +484,9 @@
|
|||
}}
|
||||
>
|
||||
<ArchiveBox className="size-3.5" strokeWidth="1.5" />
|
||||
<div class="flex items-center">{$i18n.t('Archive')}</div>
|
||||
<div class="flex items-center">
|
||||
{chat?.archived ? $i18n.t('Unarchive') : $i18n.t('Archive')}
|
||||
</div>
|
||||
</button>
|
||||
|
||||
{#if $user?.role === 'admin' || ($user?.permissions?.chat?.delete ?? true)}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue