Skip to content

Commit

Permalink
fix first load of service worker
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Aug 29, 2023
1 parent 1441436 commit ad82d3c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/sw.js
Expand Up @@ -31,6 +31,10 @@ self.addEventListener('fetch', function (event) {
event.respondWith(fetch(event.request).catch(() => {}));
});

self.addEventListener('activate', (event) => {
event.waitUntil(clients.claim());
});

function getMime(type) {
const result = mime[type];
if (result) {
Expand Down

0 comments on commit ad82d3c

Please sign in to comment.