Implement PWA splash screens and fix service worker registration (#124)

- Add iOS splash screen images and media query entries for all device sizes
- Fix splash screen media query for iPhone SE/8 (375x667 at 2x)
- Simplify registerServiceWorker to fire-and-forget void function
- Add workbox-core and workbox-window as dev dependencies for SW build
This commit is contained in:
Chris Scott authored and GitHub committed 2026-02-13 09:12:56 -05:00
1 parent 87dc4edef8
commit e3051b8aef
19 files changed
+29 -15

No files matched your search

+6 -14
View File
@@ -1,18 +1,10 @@
export async function registerServiceWorker(): Promise<ServiceWorkerRegistration | null> {
if (!("serviceWorker" in navigator)) return null;
export function registerServiceWorker(): void {
if (!("serviceWorker" in navigator)) return;
try {
const registration = await navigator.serviceWorker.register("/sw.js", {
scope: "/",
type: "module",
});
registration.update().catch(() => {});
return registration;
} catch {
return null;
}
navigator.serviceWorker
.register("/sw.js", { scope: "/", type: "module" })
.then((registration) => registration.update())
.catch(() => {});
}
export async function getServiceWorkerRegistration(): Promise<ServiceWorkerRegistration | null> {