@@ -7,7 +7,7 @@ const GITHUB_API_CACHE = 'github-api-cache-v2';
77const STATIC_CACHE = 'static-cache-v2' ;
88const EXTERNAL_CACHE = 'external-cache-v1' ;
99const TOKEN_STORE = 'github-token-store' ;
10- const STATIC_ASSETS = [ '/' , '/index.html' , '/sw.js' , '/vite.svg' , '/src/index.tsx' ] ;
10+ const STATIC_ASSETS = [ '/' , '/index.html' , '/sw.js' , '/vite.svg' , '/@vite/client' , '/ src/index.tsx'] ;
1111
1212// Install event - cache essential static assets
1313self . addEventListener ( 'install' , ( event ) => {
@@ -170,7 +170,7 @@ async function handleStaticRequest(request) {
170170// Handle navigation requests with app shell fallback
171171async function handleNavigationRequest ( request ) {
172172 const cache = await caches . open ( STATIC_CACHE ) ;
173- const shell = await cache . match ( '/index.html' ) ;
173+ const shell = await cache . match ( '/index.html' ) || await cache . match ( '/' ) ;
174174 if ( shell ) {
175175 return shell . clone ( ) ;
176176 }
@@ -187,6 +187,11 @@ async function handleNavigationRequest(request) {
187187 console . warn ( 'Navigation fetch failed:' , error ) ;
188188 }
189189
190+ const fallback = await caches . match ( '/index.html' ) || await caches . match ( '/' ) ;
191+ if ( fallback ) {
192+ return fallback . clone ( ) ;
193+ }
194+
190195 return new Response ( 'Offline - App shell unavailable' , {
191196 status : 503 ,
192197 statusText : 'Service Unavailable'
0 commit comments