fix: precache __data.json for offline client-side navigation

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 1c8bdb5f30
commit 68e3a3e1e9
+3
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() {