Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
84ec5887
Commit
84ec5887
authored
May 03, 2024
by
Timothy J. Baek
Browse files
fix: tag delete issue
parent
d4db3dd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
src/lib/components/chat/Tags.svelte
src/lib/components/chat/Tags.svelte
+16
-3
src/lib/components/layout/Sidebar/ChatMenu.svelte
src/lib/components/layout/Sidebar/ChatMenu.svelte
+7
-1
No files found.
src/lib/components/chat/Tags.svelte
View file @
84ec5887
...
...
@@ -4,11 +4,14 @@
deleteTagById,
getAllChatTags,
getChatList,
getChatListByTagName,
getTagsById,
updateChatById
} from '$lib/apis/chats';
import { tags as _tags, chats } from '$lib/stores';
import { onMount } from 'svelte';
import { createEventDispatcher, onMount } from 'svelte';
const dispatch = createEventDispatcher();
import Tags from '../common/Tags.svelte';
...
...
@@ -40,9 +43,19 @@
tags: tags
});
_tags.set(await getAllChatTags(localStorage.token));
console.log($_tags);
await _tags.set(await getAllChatTags(localStorage.token));
console.log($_tags);
if ($_tags.map((t) => t.name).includes(tagName)) {
await chats.set(await getChatListByTagName(localStorage.token, tagName));
if (!$_tags.includes(tagName)) {
if ($chats.find((chat) => chat.id === chatId)) {
dispatch('close');
}
} else {
await chats.set(await getChatList(localStorage.token));
}
};
...
...
src/lib/components/layout/Sidebar/ChatMenu.svelte
View file @
84ec5887
...
...
@@ -75,7 +75,13 @@
<hr class="border-gray-100 dark:border-gray-800 mt-2.5 mb-1.5" />
<div class="flex p-1">
<Tags {chatId} />
<Tags
{chatId}
on:close={() => {
show = false;
onClose();
}}
/>
</div>
</DropdownMenu.Content>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment