From 1b2177933c832b1999853d94910f92ebdad8968c Mon Sep 17 00:00:00 2001 From: Danny Morabito Date: Fri, 29 Nov 2024 17:32:11 +0100 Subject: [PATCH] speed up folder handling by using a list for folders and letters assinged to them rather than multiple different events --- src/components/FoldersListSidebar.svelte | 1 - src/components/MailboxFolderItems.svelte | 17 +++--- src/lib/customEventKinds.ts | 1 + src/lib/folderLabel.ts | 68 +++++++++++++++++++----- src/lib/letterToFolderMapping.ts | 25 --------- src/lib/utils.svelte.ts | 52 ++++-------------- src/routes/+page.svelte | 60 ++++++++------------- 7 files changed, 95 insertions(+), 129 deletions(-) create mode 100644 src/lib/customEventKinds.ts delete mode 100644 src/lib/letterToFolderMapping.ts diff --git a/src/components/FoldersListSidebar.svelte b/src/components/FoldersListSidebar.svelte index c4e381f..cb8ca2b 100644 --- a/src/components/FoldersListSidebar.svelte +++ b/src/components/FoldersListSidebar.svelte @@ -16,7 +16,6 @@ async function addNewFolderPressed() { const newFolder = await createFolder(newFolderName, ''); if (!newFolder) return; - await newFolder.publish(); folders = [...folders, { id: newFolder.id, name: newFolderName, icon: 'eos-icons:plus' }]; newFolderName = ''; isAddingFolder = false; diff --git a/src/components/MailboxFolderItems.svelte b/src/components/MailboxFolderItems.svelte index 16f3e1c..0623203 100644 --- a/src/components/MailboxFolderItems.svelte +++ b/src/components/MailboxFolderItems.svelte @@ -1,12 +1,13 @@