From f39a523ec001ed4312882f4cfcb3643b6af03441 Mon Sep 17 00:00:00 2001 From: silentoplayz <50341825+silentoplayz@users.noreply.github.com> Date: Wed, 6 Nov 2024 00:58:41 -0500 Subject: [PATCH 1/3] Update ArchivedChatsModal.svelte feat: Unarchive All Archived Chats button --- .../layout/Sidebar/ArchivedChatsModal.svelte | 422 ++++++++++-------- 1 file changed, 227 insertions(+), 195 deletions(-) diff --git a/src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte b/src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte index b2ae11058..ec1e4b185 100644 --- a/src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte +++ b/src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte @@ -1,220 +1,252 @@ -
-
-
{$i18n.t('Archived Chats')}
- -
+
+
+
{$i18n.t('Archived Chats')}
+ +
-
-
-
-
- - - -
- -
-
-
-
- {#if chats.length > 0} -
-
-
- - - - - - - - - {#each chats.filter((c) => searchValue === '' || c.title - .toLowerCase() - .includes(searchValue.toLowerCase())) as chat, idx} - - +
+
+
+
+ + + +
+ +
+
+
+
+ {#if chats.length > 0} +
+
+
+
{$i18n.t('Name')} -
- -
- {chat.title} -
-
-
+ + + + + + + + {#each chats.filter((c) => searchValue === '' || c.title + .toLowerCase() + .includes(searchValue.toLowerCase())) as chat, idx} + + - + - - - {/each} - -
{$i18n.t('Name')} +
+ +
+ {chat.title} +
+
+
-
- - - +
+
+ + + - - - -
-
-
-
+ + + +
+ + + {/each} + + +
+
-
- -
-
- {:else} -
- {$i18n.t('You have no archived conversations.')} -
- {/if} -
- - + {$i18n.t('Unarchive All Archived Chats')} + + + { + unarchiveAllHandler(); + }} + /> + + + + + {:else} +
+ {$i18n.t('You have no archived conversations.')} +
+ {/if} + + +
From 6ed085b90b691b61f27a1fc921904f9d074bff31 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 10 Nov 2024 16:34:35 -0800 Subject: [PATCH 2/3] chore: format --- .../layout/Sidebar/ArchivedChatsModal.svelte | 412 +++++++++--------- 1 file changed, 206 insertions(+), 206 deletions(-) diff --git a/src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte b/src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte index ec1e4b185..3ccc97f6e 100644 --- a/src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte +++ b/src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte @@ -1,55 +1,55 @@ -
-
-
{$i18n.t('Archived Chats')}
- -
+
+
+
{$i18n.t('Archived Chats')}
+ +
-
-
-
-
- - - -
- -
-
-
-
- {#if chats.length > 0} -
-
-
- - - - - - - - - {#each chats.filter((c) => searchValue === '' || c.title - .toLowerCase() - .includes(searchValue.toLowerCase())) as chat, idx} - - +
+
+
+
+ + + +
+ +
+
+
+
+ {#if chats.length > 0} +
+
+
+
{$i18n.t('Name')} -
- -
- {chat.title} -
-
-
+ + + + + + + + {#each chats.filter((c) => searchValue === '' || c.title + .toLowerCase() + .includes(searchValue.toLowerCase())) as chat, idx} + + - + - - - {/each} - -
{$i18n.t('Name')} +
+ +
+ {chat.title} +
+
+
-
- - - +
+
+ + + - - - -
-
-
-
+ + + +
+ + + {/each} + + +
+
-
- -
-
- {:else} -
- {$i18n.t('You have no archived conversations.')} -
- {/if} -
- - + + + + {:else} +
+ {$i18n.t('You have no archived conversations.')} +
+ {/if} + + +
From f7b98e8c84fd43d734e53cb8da5b0bd681919fdf Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 10 Nov 2024 16:39:11 -0800 Subject: [PATCH 3/3] refac --- .../layout/Sidebar/ArchivedChatsModal.svelte | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte b/src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte index 3ccc97f6e..260c99cf8 100644 --- a/src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte +++ b/src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte @@ -7,24 +7,24 @@ const dispatch = createEventDispatcher(); - import Modal from '$lib/components/common/Modal.svelte'; import { archiveChatById, deleteChatById, getAllArchivedChats, getArchivedChatList } from '$lib/apis/chats'; + + import Modal from '$lib/components/common/Modal.svelte'; import Tooltip from '$lib/components/common/Tooltip.svelte'; - import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; + import UnarchiveAllConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; const i18n = getContext('i18n'); export let show = false; - let searchValue = ''; - let chats = []; - let unarchiveAllDialogShow = false; + let searchValue = ''; + let showUnarchiveAllConfirmDialog = false; const unarchiveChatHandler = async (chatId) => { const res = await archiveChatById(localStorage.token, chatId).catch((error) => { @@ -65,6 +65,15 @@ } + { + unarchiveAllHandler(); + }} +/> +
@@ -212,25 +221,16 @@
-
+
- { - unarchiveAllHandler(); - }} - /> -