Skip to content

Commit

Permalink
Update serviceWorker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
datajohnson committed May 30, 2024
1 parent d2a2d68 commit 39f78f6
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions web/public/serviceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@

// This is the code piece that GenerateSW mode can't provide for us.
// This code listens for the user's confirmation to update the app.
self.addEventListener('message', event => {
console.log(event);
if (event.data && event.data.type === 'SKIP_WAITING') {
self.addEventListener("message", (event) => {
console.log("MESSAGE", event);
if (event.data && event.data.type === "SKIP_WAITING") {
self.skipWaiting();
}
});

console.log("Loading serviceWorker.js")
self.addEventListener("fetch", (event) => {
console.log("FETCH", event);
if (event.data && event.data.type === "SKIP_WAITING") {
self.skipWaiting();
}
});

console.log("Loading serviceWorker.js");

//workbox.clientsClaim();

// The precaching code provided by Workbox.
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.suppressWarnings();
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
//self.__precacheManifest = [].concat(self.__precacheManifest || []);
//workbox.precaching.suppressWarnings();
//workbox.precaching.precacheAndRoute(self.__precacheManifest, {});

0 comments on commit 39f78f6

Please sign in to comment.