diff --git a/src/lib/components/chat/Tags.svelte b/src/lib/components/chat/Tags.svelte
index 47e63198f..cb4e54641 100644
--- a/src/lib/components/chat/Tags.svelte
+++ b/src/lib/components/chat/Tags.svelte
@@ -8,7 +8,7 @@
getTagsById,
updateChatById
} from '$lib/apis/chats';
- import { tags as _tags, chats } from '$lib/stores';
+ import { tags as _tags, chats, pinnedChats } from '$lib/stores';
import { createEventDispatcher, onMount } from 'svelte';
const dispatch = createEventDispatcher();
@@ -19,9 +19,11 @@
let tags = [];
const getTags = async () => {
- return await getTagsById(localStorage.token, chatId).catch(async (error) => {
- return [];
- });
+ return (
+ await getTagsById(localStorage.token, chatId).catch(async (error) => {
+ return [];
+ })
+ ).filter((tag) => tag.name !== 'pinned');
};
const addTag = async (tagName) => {
@@ -33,6 +35,7 @@
});
_tags.set(await getAllChatTags(localStorage.token));
+ await pinnedChats.set(await getChatListByTagName(localStorage.token, 'pinned'));
};
const deleteTag = async (tagName) => {
@@ -44,19 +47,23 @@
});
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 (tagName === 'pinned') {
+ await pinnedChats.set(await getChatListByTagName(localStorage.token, 'pinned'));
+ } else {
+ await chats.set(await getChatListByTagName(localStorage.token, tagName));
+ }
if ($chats.find((chat) => chat.id === chatId)) {
dispatch('close');
}
} else {
await chats.set(await getChatList(localStorage.token));
+ await pinnedChats.set(await getChatListByTagName(localStorage.token, 'pinned'));
}
};
diff --git a/src/lib/components/icons/Bookmark.svelte b/src/lib/components/icons/Bookmark.svelte
new file mode 100644
index 000000000..ea8028457
--- /dev/null
+++ b/src/lib/components/icons/Bookmark.svelte
@@ -0,0 +1,19 @@
+
+
+
diff --git a/src/lib/components/icons/BookmarkSlash.svelte b/src/lib/components/icons/BookmarkSlash.svelte
new file mode 100644
index 000000000..6b80ea3ca
--- /dev/null
+++ b/src/lib/components/icons/BookmarkSlash.svelte
@@ -0,0 +1,19 @@
+
+
+
diff --git a/src/lib/components/icons/ChatMenu.svelte b/src/lib/components/icons/ChatMenu.svelte
new file mode 100644
index 000000000..673e643b1
--- /dev/null
+++ b/src/lib/components/icons/ChatMenu.svelte
@@ -0,0 +1,124 @@
+
+
+
+
+