From cc74bfc72871b430b72c9d0daaceed910475ef3f Mon Sep 17 00:00:00 2001 From: alma Date: Mon, 28 Apr 2025 17:19:14 +0200 Subject: [PATCH] courrier multi account restore compose --- app/courrier/page.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/courrier/page.tsx b/app/courrier/page.tsx index 813faab4..7a1e16a8 100644 --- a/app/courrier/page.tsx +++ b/app/courrier/page.tsx @@ -588,15 +588,24 @@ export default function CourrierPage() { return; } - // Update selected folders state without validation + // Use the exact folder name from the account's folders list + if (!account.folders.includes(folder)) { + console.warn(`Folder ${folder} not found in account ${accountId}`); + return; + } + + // Update selected folders state setSelectedFolders(prev => ({ ...prev, [accountId]: folder })); + + // Change to the selected folder + changeFolder(folder, accountId); + } else { + // For all accounts view, use the original folder name + changeFolder(folder, accountId); } - - // Change to the selected folder without additional validation - changeFolder(folder, accountId); }; // Update the folder button rendering to show selected state based on account