courrier multi account restore compose

This commit is contained in:
alma 2025-04-28 14:43:39 +02:00
parent 795a9f4629
commit c102b6e89b
2 changed files with 7 additions and 6 deletions

View File

@ -507,8 +507,8 @@ export default function CourrierPage() {
console.log(`Changing folder to ${folder} for account ${accountId}`); console.log(`Changing folder to ${folder} for account ${accountId}`);
} }
// Change folder in the state // Change folder in the state, passing the accountId
changeFolder(folder); changeFolder(folder, accountId);
setCurrentView(folder); setCurrentView(folder);
// Start prefetching additional pages for this folder // Start prefetching additional pages for this folder

View File

@ -538,10 +538,11 @@ export const useCourrier = () => {
setSelectedEmail(null); setSelectedEmail(null);
setSelectedEmailIds([]); setSelectedEmailIds([]);
// Load the emails for this folder // Load the emails for this folder with the correct accountId
// The loadEmails function will be called by the useEffect above if (session?.user?.id) {
// due to the dependency on currentFolder loadEmails(false, accountId);
}, []); }
}, [session?.user?.id, loadEmails]);
// Search emails // Search emails
const searchEmails = useCallback((query: string) => { const searchEmails = useCallback((query: string) => {