courrier multi account restore compose

This commit is contained in:
alma 2025-04-28 17:08:13 +02:00
parent d1a873dcea
commit 55cdee80a0

View File

@ -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);
};