mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2024-11-10 05:34:44 +00:00
3580941207
fix favicon link issue in ReviewDetails.html Co-authored-by: rheabhutada02 <rheabhutada02@users.noreply.github.com> Signed-off-by: Arthur Lu <learthurgo@gmail.com>
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
const CACHE_NAME = "food-journal-v1";
|
|
const ASSETS = [
|
|
"index.html",
|
|
"ReviewDetails.html",
|
|
"CreatePage.html",
|
|
"static/CoveredByYourGrace-Regular.ttf",
|
|
"static/CreatePage.css",
|
|
"static/Form.css",
|
|
"static/homepage.css",
|
|
"static/ReviewDetails.css",
|
|
"assets/images/0-star.svg",
|
|
"assets/images/1-star.svg",
|
|
"assets/images/2-star.svg",
|
|
"assets/images/3-star.svg",
|
|
"assets/images/4-star.svg",
|
|
"assets/images/5-star.svg",
|
|
"assets/images/default_plate.png",
|
|
"assets/images/delete_icon_for_interface.png",
|
|
"assets/images/edit_button_for_interface.png",
|
|
"assets/images/Grouppink.png",
|
|
"assets/images/home_button_for_interface.png",
|
|
"assets/images/favicon.ico",
|
|
"assets/images/Logo.png",
|
|
"assets/scripts/CreatePage.js",
|
|
"assets/scripts/localStorage.js",
|
|
"assets/scripts/main.js",
|
|
"assets/scripts/ReviewCard.js",
|
|
"assets/scripts/ReviewDetails.js",
|
|
];
|
|
|
|
self.addEventListener("install", async () => {
|
|
const cache = await caches.open(CACHE_NAME);
|
|
await cache.addAll(ASSETS);
|
|
});
|
|
|
|
self.addEventListener("fetch", (event) => {
|
|
event.respondWith(caches.open(CACHE_NAME).then((cache) => {
|
|
return fetch(event.request).then((fetchedResponse) => {
|
|
cache.put(event.request, fetchedResponse.clone());
|
|
return fetchedResponse;
|
|
}).catch(() => {
|
|
return cache.match(event.request);
|
|
});
|
|
}));
|
|
});
|