From 55cdee80a0c58114fd3b4650524e9b4f27343e17 Mon Sep 17 00:00:00 2001 From: alma Date: Mon, 28 Apr 2025 17:08:13 +0200 Subject: [PATCH] courrier multi account restore compose --- app/courrier/page.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/courrier/page.tsx b/app/courrier/page.tsx index 431184a9..591072f4 100644 --- a/app/courrier/page.tsx +++ b/app/courrier/page.tsx @@ -576,14 +576,20 @@ export default function CourrierPage() { const handleMailboxChange = (folder: string, accountId?: string) => { if (accountId && accountId !== 'all-accounts') { const account = accounts.find(a => a.id === accountId); - if (!account?.folders?.includes(folder)) { - folder = 'INBOX'; // Fallback to INBOX if folder doesn't exist + + if (!account) { + console.warn(`Account ${accountId} not found`); + return; } + + // Update selected folders state without validation setSelectedFolders(prev => ({ ...prev, [accountId]: folder })); } + + // Change to the selected folder without additional validation changeFolder(folder, accountId); };