fix: precache __data.json for offline client-side navigation
All checks were successful
CI / update (push) Successful in 2m2s

The fitness pages were only precaching HTML shells, but SvelteKit
client-side navigation fetches __data.json instead. Without these
cached, navigating to workout/training while offline would fail.
This commit is contained in:
2026-03-23 22:28:35 +01:00
parent 9245f3e17f
commit 1ea0899bee

View File

@@ -31,6 +31,9 @@
];
const urls = slugs.map((s) => `/fitness/${s}`);
navigator.serviceWorker.controller.postMessage({ type: 'CACHE_PAGES', urls });
// Also cache __data.json for client-side navigation
const dataUrls = slugs.map((s) => `/fitness/${s}/__data.json`);
navigator.serviceWorker.controller.postMessage({ type: 'CACHE_DATA', urls: dataUrls });
}
function onOnline() {