fix: chat drag and drop

This commit is contained in:
Timothy Jaeryang Baek 2025-01-04 02:42:26 -08:00
parent b4d91b5cb4
commit 614379a427
2 changed files with 7 additions and 16 deletions

View File

@ -558,19 +558,6 @@
on:input={searchDebounceHandler} on:input={searchDebounceHandler}
placeholder={$i18n.t('Search')} placeholder={$i18n.t('Search')}
/> />
<div class="absolute z-40 right-3.5 top-1">
<Tooltip content={$i18n.t('New folder')}>
<button
class="p-1 rounded-lg bg-gray-50 hover:bg-gray-100 dark:bg-gray-950 dark:hover:bg-gray-900 text-gray-500 dark:text-gray-500 transition"
on:click={() => {
createFolder();
}}
>
<Plus className=" size-3" strokeWidth="2.5" />
</button>
</Tooltip>
</div>
</div> </div>
<div <div
@ -605,6 +592,10 @@
collapsible={!search} collapsible={!search}
className="px-2 mt-0.5" className="px-2 mt-0.5"
name={$i18n.t('Chats')} name={$i18n.t('Chats')}
onAdd={() => {
createFolder();
}}
onAddLabel={$i18n.t('New Folder')}
on:import={(e) => { on:import={(e) => {
importChatHandler(e.detail); importChatHandler(e.detail);
}} }}
@ -631,7 +622,7 @@
} }
if (chat.pinned) { if (chat.pinned) {
const res = await toggleChatPinnedStatusById(localStorage.token, chat, id); const res = await toggleChatPinnedStatusById(localStorage.token, chat.id);
} }
initChatList(); initChatList();
@ -661,7 +652,7 @@
{#if !search && $pinnedChats.length > 0} {#if !search && $pinnedChats.length > 0}
<div class="flex flex-col space-y-1 rounded-xl"> <div class="flex flex-col space-y-1 rounded-xl">
<Folder <Folder
className="px-2" className=""
bind:open={showPinnedChat} bind:open={showPinnedChat}
on:change={(e) => { on:change={(e) => {
localStorage.setItem('showPinnedChat', e.detail); localStorage.setItem('showPinnedChat', e.detail);

View File

@ -19,7 +19,7 @@
{#each folderList as folderId (folderId)} {#each folderList as folderId (folderId)}
<RecursiveFolder <RecursiveFolder
className="px-2" className=""
{folders} {folders}
{folderId} {folderId}
on:import={(e) => { on:import={(e) => {