courrier multi account restore compose
This commit is contained in:
parent
5f2da42848
commit
22f693884e
@ -531,8 +531,21 @@ export default function CourrierPage() {
|
|||||||
// Reset to page 1 when changing folders
|
// Reset to page 1 when changing folders
|
||||||
setPage(1);
|
setPage(1);
|
||||||
|
|
||||||
// If we have a specific accountId, store it with the folder
|
// If we have a specific accountId, validate the folder exists for that account
|
||||||
if (accountId) {
|
if (accountId && accountId !== 'all-accounts') {
|
||||||
|
const account = accounts.find(a => a.id === accountId);
|
||||||
|
if (!account) {
|
||||||
|
console.error(`Account ${accountId} not found`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the folder exists for this account
|
||||||
|
if (!account.folders?.includes(folder)) {
|
||||||
|
console.error(`Folder ${folder} does not exist for account ${accountId}`);
|
||||||
|
// Fall back to INBOX if the folder doesn't exist
|
||||||
|
folder = 'INBOX';
|
||||||
|
}
|
||||||
|
|
||||||
// Store the current account ID with the folder change
|
// Store the current account ID with the folder change
|
||||||
console.log(`Changing folder to ${folder} for account ${accountId}`);
|
console.log(`Changing folder to ${folder} for account ${accountId}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -108,6 +108,7 @@ export const useCourrier = () => {
|
|||||||
// Add accountId if provided and not 'loading-account'
|
// Add accountId if provided and not 'loading-account'
|
||||||
if (accountId && accountId !== 'all-accounts' && accountId !== 'loading-account') {
|
if (accountId && accountId !== 'all-accounts' && accountId !== 'loading-account') {
|
||||||
queryParams.set('accountId', accountId);
|
queryParams.set('accountId', accountId);
|
||||||
|
console.log(`Loading emails for account ${accountId} in folder ${currentFolder}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// First try Redis cache with low timeout
|
// First try Redis cache with low timeout
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user