courrier multi account restore compose
This commit is contained in:
parent
f306d94729
commit
f0710c474b
@ -396,13 +396,22 @@ export const useCourrier = () => {
|
||||
// Log what we're doing
|
||||
console.log(`[PAGINATION] Loading page ${page} for folder ${currentFolder}`);
|
||||
|
||||
// Simple approach that doesn't require complex parameter handling
|
||||
changeFolder(currentFolder)
|
||||
// CRITICAL FIX: Extract account ID from current folder to ensure pagination uses the correct account
|
||||
let accountId: string | undefined;
|
||||
|
||||
if (currentFolder && currentFolder.includes(':')) {
|
||||
const parts = currentFolder.split(':');
|
||||
accountId = parts[0];
|
||||
console.log(`[PAGINATION] Extracted account ID ${accountId} from folder ${currentFolder}`);
|
||||
}
|
||||
|
||||
// Call changeFolder with explicit account ID when available
|
||||
changeFolder(currentFolder, accountId)
|
||||
.catch(err => {
|
||||
console.error(`[PAGINATION] Error loading more emails:`, err);
|
||||
});
|
||||
}
|
||||
}, [page, session?.user?.id, changeFolder]); // Deliberately NOT including currentFolder here
|
||||
}, [page, session?.user?.id, changeFolder, currentFolder]); // Include currentFolder for correct account ID extraction
|
||||
|
||||
// ADDING DEBUG LOGS to track currentFolder changes
|
||||
useEffect(() => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user