Skip to content

Commit

Permalink
fix(pwa): fix fallback page
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesrocket committed Mar 27, 2024
1 parent 9c4a94b commit 02f07b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions static/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ oninstall = (event) => {
event.waitUntil(
(async () => {
const cache = await caches.open(cacheName);
await cache.add("/offline/index.html");
await cache.add("/offline/");
console.log("Service worker added offline page");
})(),
);
Expand Down Expand Up @@ -43,7 +43,7 @@ onfetch = (event) => {
}

return response;
});
}).catch(() => caches.match("/offline/"));
})
.catch((error) => {
console.error("Error in service worker fetch handler:", error);
Expand Down

0 comments on commit 02f07b7

Please sign in to comment.