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