courrier multi account restore compose
This commit is contained in:
parent
d683458213
commit
f1adfca1d9
@ -245,7 +245,6 @@ export default function CourrierPage() {
|
||||
console.log('allAccounts is array:', Array.isArray(data.allAccounts));
|
||||
console.log('allAccounts length:', data.allAccounts?.length || 0);
|
||||
|
||||
// Inspect each account's structure
|
||||
if (data.authenticated) {
|
||||
if (data.hasEmailCredentials) {
|
||||
console.log('Session initialized, prefetch status:', data.prefetchStarted ? 'running' : 'not started');
|
||||
@ -330,11 +329,12 @@ export default function CourrierPage() {
|
||||
console.log('Auto-selecting account:', updatedAccounts[1]);
|
||||
setSelectedAccount(updatedAccounts[1]);
|
||||
setShowFolders(true);
|
||||
}
|
||||
|
||||
// Preload first page of emails for faster initial rendering
|
||||
// Load emails for the selected account
|
||||
if (session?.user?.id) {
|
||||
await loadEmails();
|
||||
}
|
||||
}
|
||||
|
||||
// If the user hasn't opened this page recently, trigger a background refresh
|
||||
if (data.lastVisit && Date.now() - data.lastVisit > 5 * 60 * 1000) {
|
||||
@ -350,7 +350,6 @@ export default function CourrierPage() {
|
||||
console.error('Failed to trigger background refresh', error);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// User is authenticated but doesn't have email credentials
|
||||
setShowLoginNeeded(true);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user