From e34177ba6940380a665eca79d462011c7e875b35 Mon Sep 17 00:00:00 2001 From: xinyan Date: Tue, 9 Dec 2025 22:12:37 +0800 Subject: [PATCH] modified: src/lib/components/layout/ImportChatsModal.svelte modified: src/lib/components/layout/Sidebar.svelte --- .../components/layout/ImportChatsModal.svelte | 4 +- src/lib/components/layout/Sidebar.svelte | 2475 ++++++++--------- 2 files changed, 1171 insertions(+), 1308 deletions(-) diff --git a/src/lib/components/layout/ImportChatsModal.svelte b/src/lib/components/layout/ImportChatsModal.svelte index 30302bc650..7b746583c6 100644 --- a/src/lib/components/layout/ImportChatsModal.svelte +++ b/src/lib/components/layout/ImportChatsModal.svelte @@ -258,7 +258,7 @@ {#if rawChats.length > 0}
- Total: {rawChats.length} | Selected: {selectedIndices.size} + 总计: {rawChats.length} | 已选: {selectedIndices.size}
diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 38bd20373d..a44c3858c0 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -1,1367 +1,1230 @@ { - await initChatList(); - }} + bind:show={$showArchivedChats} + onUpdate={async () => { + await initChatList(); + }} /> { - const res = await createNewChannel(localStorage.token, { - name: name, - access_control: access_control - }).catch((error) => { - toast.error(`${error}`); - return null; - }); + bind:show={showCreateChannel} + onSubmit={async ({ name, access_control }) => { + const res = await createNewChannel(localStorage.token, { + name: name, + access_control: access_control + }).catch((error) => { + toast.error(`${error}`); + return null; + }); - if (res) { - $socket.emit('join-channels', { auth: { token: $user?.token } }); - await initChannels(); - showCreateChannel = false; - } - }} + if (res) { + $socket.emit('join-channels', { auth: { token: $user?.token } }); + await initChannels(); + showCreateChannel = false; + } + }} /> { - await createFolder(folder); - showCreateFolderModal = false; - }} + bind:show={showCreateFolderModal} + onSubmit={async (folder) => { + await createFolder(folder); + showCreateFolderModal = false; + }} /> - - {#if $showSidebar} -
{ - showSidebar.set(!$showSidebar); - }} - /> +
{ + showSidebar.set(!$showSidebar); + }} + /> {/if} { - if ($mobile) { - showSidebar.set(false); - } - }} + bind:show={$showSearch} + onClose={() => { + if ($mobile) { + showSidebar.set(false); + } + }} /> - -
+ +
+ + + -
- + - - - - - -
- - -
-
-
- {#if $user !== undefined && $user !== null} - { - if (e.detail === 'archived-chat') { - showArchivedChats.set(true); - } - if (e.detail === 'announcements') { - showAnnouncements.set(true); - } - }} - > -
-
- {$i18n.t('Open -
-
-
- {/if} -
-
-
- +
+
+
+ {#if $user !== undefined && $user !== null} + { + if (e.detail === 'archived-chat') { + showArchivedChats.set(true); + } + if (e.detail === 'announcements') { + showAnnouncements.set(true); + } + }} + > +
+
+ {$i18n.t('Open +
+
+
+ {/if} +
+
+
+ {/if} {#if $showSidebar} - + + {/if} { - await importChatsHandler(chats); - }} -/> + bind:show={showImportChatsModal} + onImport={async (chats) => { + await importChatsHandler(chats); + }} +/> \ No newline at end of file