From 8648a330f22e42017400b2927dc33b59970cbdd7 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 18 Oct 2024 14:11:13 -0700 Subject: [PATCH] refac --- src/lib/components/common/Folder.svelte | 9 +++++---- src/lib/components/layout/Sidebar.svelte | 2 +- .../components/layout/Sidebar/ChatItem.svelte | 6 +++--- .../layout/Sidebar/RecursiveFolder.svelte | 3 ++- .../components/layout/Sidebar/UserMenu.svelte | 16 ++++++++-------- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/lib/components/common/Folder.svelte b/src/lib/components/common/Folder.svelte index e8a04db91..ab1507545 100644 --- a/src/lib/components/common/Folder.svelte +++ b/src/lib/components/common/Folder.svelte @@ -48,6 +48,7 @@ try { const fileContent = JSON.parse(event.target.result); console.log('Parsed JSON Content: ', fileContent); + open = true; dispatch('import', fileContent); } catch (error) { console.error('Error parsing JSON file:', error); @@ -59,12 +60,12 @@ } else { console.error('Only JSON file types are supported.'); } - - console.log(file); } else { - // Handle the drag-and-drop data for folders or chats (same as before) + open = true; + const dataTransfer = e.dataTransfer.getData('text/plain'); const data = JSON.parse(dataTransfer); + console.log(data); dispatch('drop', data); } @@ -98,7 +99,7 @@
{#if draggedOver}
{/if} diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 3c9babfc3..ad3a08398 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -656,7 +656,7 @@ { importChatHandler(e.detail); diff --git a/src/lib/components/layout/Sidebar/ChatItem.svelte b/src/lib/components/layout/Sidebar/ChatItem.svelte index 7a189ecf9..bc5bb80e0 100644 --- a/src/lib/components/layout/Sidebar/ChatItem.svelte +++ b/src/lib/components/layout/Sidebar/ChatItem.svelte @@ -207,7 +207,7 @@ -
{$i18n.t('Playground')}
+
{$i18n.t('Playground')}
-
{$i18n.t('Admin Panel')}
+
{$i18n.t('Admin Panel')}
{/if} @@ -179,7 +179,7 @@ /> -
{$i18n.t('Sign Out')}
+
{$i18n.t('Sign Out')}
{#if $activeUserCount} @@ -201,7 +201,7 @@
- + {$i18n.t('Active Users')}: @@ -212,7 +212,7 @@ {/if} -