summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-11-11 23:04:35 -0500
committerOwen Jacobson <owen@grimoire.ca>2024-11-11 23:04:35 -0500
commitc82e40caa38edf02ebda49be6ce42afb0e0907c4 (patch)
treec72c4419679041580f3e56d86f9d5860ee950651 /ui
parentc6c46436558f5058eccdb9b793ed02fc1640a80d (diff)
npm run format
Diffstat (limited to 'ui')
-rw-r--r--ui/service-worker.js36
-rw-r--r--ui/static/manifest.json24
2 files changed, 34 insertions, 26 deletions
diff --git a/ui/service-worker.js b/ui/service-worker.js
index e2143b3..9855a73 100644
--- a/ui/service-worker.js
+++ b/ui/service-worker.js
@@ -15,29 +15,29 @@ import { build, files, version } from '$service-worker';
const CACHE = `cache-${version}`;
const ASSETS = [
- ...build, // the app itself
- ...files // everything in `static`
+ ...build, // the app itself
+ ...files // everything in `static`
];
self.addEventListener('install', (event) => {
- // Create a new cache and add all files to it
- async function addFilesToCache() {
- const cache = await caches.open(CACHE);
- await cache.addAll(ASSETS);
- }
+ // Create a new cache and add all files to it
+ async function addFilesToCache() {
+ const cache = await caches.open(CACHE);
+ await cache.addAll(ASSETS);
+ }
- event.waitUntil(addFilesToCache());
+ event.waitUntil(addFilesToCache());
});
self.addEventListener('activate', (event) => {
- // Remove previous cached data from disk
- async function deleteOldCaches() {
- for (const key of await caches.keys()) {
- if (key !== CACHE) await caches.delete(key);
- }
- }
-
- event.waitUntil(deleteOldCaches());
+ // Remove previous cached data from disk
+ async function deleteOldCaches() {
+ for (const key of await caches.keys()) {
+ if (key !== CACHE) await caches.delete(key);
+ }
+ }
+
+ event.waitUntil(deleteOldCaches());
});
// The simplest possible use of the caches above:
@@ -47,8 +47,8 @@ async function cacheFirst(request) {
return responseFromCache;
}
return fetch(request);
-};
+}
-self.addEventListener("fetch", (event) => {
+self.addEventListener('fetch', (event) => {
event.respondWith(cacheFirst(event.request));
});
diff --git a/ui/static/manifest.json b/ui/static/manifest.json
index 29e3e90..938955e 100644
--- a/ui/static/manifest.json
+++ b/ui/static/manifest.json
@@ -9,35 +9,43 @@
"icons": [
{
"src": "/favicon.png",
- "type": "image/png", "sizes": "72x72"
+ "type": "image/png",
+ "sizes": "72x72"
},
{
"src": "/favicon.png",
- "type": "image/png", "sizes": "96x96"
+ "type": "image/png",
+ "sizes": "96x96"
},
{
"src": "/favicon.png",
- "type": "image/png","sizes": "128x128"
+ "type": "image/png",
+ "sizes": "128x128"
},
{
"src": "/favicon.png",
- "type": "image/png", "sizes": "144x144"
+ "type": "image/png",
+ "sizes": "144x144"
},
{
"src": "/favicon.png",
- "type": "image/png", "sizes": "152x152"
+ "type": "image/png",
+ "sizes": "152x152"
},
{
"src": "/favicon.png",
- "type": "image/png", "sizes": "192x192"
+ "type": "image/png",
+ "sizes": "192x192"
},
{
"src": "/favicon.png",
- "type": "image/png", "sizes": "384x384"
+ "type": "image/png",
+ "sizes": "384x384"
},
{
"src": "/favicon.png",
- "type": "image/png", "sizes": "512x512"
+ "type": "image/png",
+ "sizes": "512x512"
}
]
}