File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,18 +17,32 @@ const APP_SHELL = [
1717
1818self . addEventListener ( "install" , ( event ) => {
1919 event . waitUntil (
20- caches
21- . open ( APP_CACHE )
22- . then ( ( cache ) =>
23- cache
24- . addAll ( APP_SHELL )
25- . catch ( ( err ) =>
26- console . warn (
27- "[SW] Pre-cache failed, will rely on dynamic caching:" ,
28- err ,
20+ Promise . all ( [
21+ caches
22+ . open ( APP_CACHE )
23+ . then ( ( cache ) =>
24+ cache
25+ . addAll ( APP_SHELL )
26+ . catch ( ( err ) =>
27+ console . warn (
28+ "[SW] Pre-cache failed, will rely on dynamic caching:" ,
29+ err ,
30+ ) ,
2931 ) ,
30- ) ,
31- ) ,
32+ ) ,
33+ caches
34+ . open ( TRANSLATIONS_CACHE )
35+ . then ( ( cache ) =>
36+ cache
37+ . addAll ( [ "./translations/en.json" ] )
38+ . catch ( ( err ) =>
39+ console . warn (
40+ "[SW] Translation pre-cache failed, will rely on dynamic caching:" ,
41+ err ,
42+ ) ,
43+ ) ,
44+ ) ,
45+ ] ) ,
3246 ) ;
3347 self . skipWaiting ( ) ;
3448} ) ;
You can’t perform that action at this time.
0 commit comments