diff --git a/frontend/src/lib/offlinePrefetch.ts b/frontend/src/lib/offlinePrefetch.ts index 6878e98..2a42941 100644 --- a/frontend/src/lib/offlinePrefetch.ts +++ b/frontend/src/lib/offlinePrefetch.ts @@ -37,6 +37,18 @@ async function fetchOnce(url: string): Promise { async function run(): Promise { if (!(await offlineReady()) || isOffline()) return; + // What the app asks for when it starts (who is signed in, accounts, folders…). + // The page fetched these once on load — possibly before the service worker + // was there to save them — so fetch them again now, or the app could not + // start offline at all. + await Promise.allSettled([ + api.me(), + api.accounts(), + api.mailboxes(), + api.quota(), + api.savedSearches(), + api.uiManifest(), + ]); const settings = await api.settings(); const order = settings.thread_order ?? "asc"; // The list as the app shows it (newest first is the default), plus the other