fix: tag unarchive/archive issue

This commit is contained in:
Timothy J. Baek
2024-10-14 22:57:11 -07:00
parent d8a30bd6ae
commit 6703cacb99
9 changed files with 72 additions and 30 deletions
@@ -15,7 +15,6 @@
getArchivedChatList
} from '$lib/apis/chats';
import Tooltip from '$lib/components/common/Tooltip.svelte';
const i18n = getContext('i18n');
export let show = false;
@@ -30,7 +29,6 @@
});
chats = await getArchivedChatList(localStorage.token);
dispatch('change');
};
@@ -10,6 +10,7 @@
archiveChatById,
cloneChatById,
deleteChatById,
getAllTags,
getChatList,
getChatListByTagName,
getPinnedChatList,
@@ -22,7 +23,8 @@
mobile,
pinnedChats,
showSidebar,
currentChatPage
currentChatPage,
tags
} from '$lib/stores';
import ChatMenu from './ChatMenu.svelte';
@@ -77,6 +79,7 @@
const archiveChatHandler = async (id) => {
await archiveChatById(localStorage.token, id);
tags.set(await getAllTags(localStorage.token));
currentChatPage.set(1);
await chats.set(await getChatList(localStorage.token, $currentChatPage));
@@ -15,13 +15,8 @@
import DocumentDuplicate from '$lib/components/icons/DocumentDuplicate.svelte';
import Bookmark from '$lib/components/icons/Bookmark.svelte';
import BookmarkSlash from '$lib/components/icons/BookmarkSlash.svelte';
import {
addTagById,
deleteTagById,
getChatPinnedStatusById,
getTagsById,
toggleChatPinnedStatusById
} from '$lib/apis/chats';
import { getChatPinnedStatusById, toggleChatPinnedStatusById } from '$lib/apis/chats';
import { chats } from '$lib/stores';
const i18n = getContext('i18n');
@@ -146,6 +141,7 @@
type: 'add',
name: e.detail.name
});
show = false;
}}
on:delete={(e) => {
@@ -153,6 +149,7 @@
type: 'delete',
name: e.detail.name
});
show = false;
}}
on:close={() => {