File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -55,15 +55,6 @@ const FILES_TO_CACHE = [
5555
5656self . addEventListener ( 'install' , ( evt ) => {
5757
58- // precache static resources
59- evt . waitUntil (
60- caches . open ( WORKER_NAME ) . then ( ( cache ) => {
61- return cache . addAll ( FILES_TO_CACHE ) ;
62- } )
63- ) ;
64-
65- self . skipWaiting ( ) ;
66-
6758} ) ;
6859
6960self . addEventListener ( 'activate' , ( evt ) => {
@@ -79,6 +70,19 @@ self.addEventListener('activate', (evt) => {
7970 } )
8071 ) ;
8172
73+ self . clients . claim ( ) ;
74+
75+
76+ // precache static resources
77+ evt . waitUntil (
78+ caches . open ( WORKER_NAME ) . then ( ( cache ) => {
79+ return cache . addAll ( FILES_TO_CACHE ) ;
80+ } )
81+ ) ;
82+
83+ self . skipWaiting ( ) ;
84+
85+
8286 // send reload request to client
8387 /*workerChannel.postMessage({
8488 type: 'reload'
You can’t perform that action at this time.
0 commit comments