mirror of
https://github.com/open-webui/open-webui
synced 2025-01-18 00:30:51 +00:00
fix: tag deletion rehydration bug
fixes a bug that caused the deletion of a tag, when filtering by tag, to rehydrate all chats instead of the filtered list.
This commit is contained in:
parent
cdac0cd1df
commit
287559e834
@ -47,26 +47,24 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
await _tags.set(await getAllChatTags(localStorage.token));
|
await _tags.set(await getAllChatTags(localStorage.token));
|
||||||
|
|
||||||
if ($_tags.map((t) => t.name).includes(tagName)) {
|
if ($_tags.map((t) => t.name).includes(tagName)) {
|
||||||
if (tagName === 'pinned') {
|
if (tagName === 'pinned') {
|
||||||
await pinnedChats.set(await getChatListByTagName(localStorage.token, 'pinned'));
|
await pinnedChats.set(await getChatListByTagName(localStorage.token, 'pinned'));
|
||||||
} else {
|
} else {
|
||||||
await chats.set(
|
await chats.set(await getChatListByTagName(localStorage.token, tagName));
|
||||||
await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($chats.find((chat) => chat.id === chatId)) {
|
if ($chats.find((chat) => chat.id === chatId)) {
|
||||||
dispatch('close');
|
dispatch('close');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// if the tag we deleted is no longer a valid tag, return to main chat list view
|
||||||
|
tagView.set(false);
|
||||||
await chats.set(
|
await chats.set(
|
||||||
await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit)
|
await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit)
|
||||||
);
|
);
|
||||||
await pinnedChats.set(await getChatListByTagName(localStorage.token, 'pinned'));
|
await pinnedChats.set(await getChatListByTagName(localStorage.token, 'pinned'));
|
||||||
}
|
}
|
||||||
tagView.set(false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user