From a768221be90a744c0a479ab6b1adef9a6d039b0d Mon Sep 17 00:00:00 2001 From: alma Date: Wed, 16 Apr 2025 17:33:08 +0200 Subject: [PATCH] Neah version mail stable 3? --- app/api/mail/route.ts | 4 +++- app/mail/page.tsx | 15 ++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/app/api/mail/route.ts b/app/api/mail/route.ts index 2c6a9c0..6a08520 100644 --- a/app/api/mail/route.ts +++ b/app/api/mail/route.ts @@ -148,7 +148,9 @@ export async function GET(request: Request) { return; } - const availableMailboxes = Object.keys(boxes); + const availableMailboxes = Object.keys(boxes).filter( + box => !['Starred', 'Archives'].includes(box) + ); console.log('Available mailboxes:', availableMailboxes); // Only process the requested folder diff --git a/app/mail/page.tsx b/app/mail/page.tsx index 0601f88..f81d436 100644 --- a/app/mail/page.tsx +++ b/app/mail/page.tsx @@ -430,7 +430,6 @@ function cleanEmailContent(content: string): string { // Define the exact folder names from IMAP type MailFolder = string; -type MailView = MailFolder | 'starred'; // Map IMAP folders to sidebar items with icons const getFolderIcon = (folder: string) => { @@ -453,19 +452,13 @@ const getFolderIcon = (folder: string) => { } }; -// Initial sidebar items +// Initial sidebar items - only INBOX const initialSidebarItems = [ { - view: 'INBOX' as MailView, + view: 'INBOX' as MailFolder, label: 'Inbox', icon: Inbox, folder: 'INBOX' - }, - { - view: 'starred' as MailView, - label: 'Starred', - icon: Star, - folder: null } ]; @@ -477,7 +470,7 @@ export default function MailPage() { { id: 1, name: 'Mail', email: 'alma@governance-labs.org', color: 'bg-blue-500' } ]); const [selectedAccount, setSelectedAccount] = useState(null); - const [currentView, setCurrentView] = useState('INBOX'); + const [currentView, setCurrentView] = useState('INBOX'); const [showCompose, setShowCompose] = useState(false); const [showDeleteConfirm, setShowDeleteConfirm] = useState(false); const [selectedEmails, setSelectedEmails] = useState([]); @@ -1026,7 +1019,7 @@ export default function MailPage() { ...availableFolders .filter(folder => !['INBOX'].includes(folder)) // Exclude folders already in initial items .map(folder => ({ - view: folder as MailView, + view: folder as MailFolder, label: folder.charAt(0).toUpperCase() + folder.slice(1).toLowerCase(), icon: getFolderIcon(folder), folder: folder