PWA installability + working service worker (wishlist #8)

manifest.webmanifest with the existing icons, apple-touch-icon, and SW
registration at startup. The old sw.js was a self-unregistering cleanup
stub — meaning serviceWorker.ready never resolved and web push has been
silently dead; the new worker handles push display and notification
clicks, and makes the app installable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Carlos Escalante
2026-06-12 18:07:02 -06:00
parent c3c14f54c5
commit fc3461c377
4 changed files with 78 additions and 2 deletions

View File

@@ -3,6 +3,13 @@ import { createRoot } from "react-dom/client";
import App from "./App";
import "./index.css";
if ("serviceWorker" in navigator) {
// Required for both web push and PWA installability.
navigator.serviceWorker.register("/sw.js").catch((err) => {
console.warn("Service worker registration failed:", err);
});
}
createRoot(document.getElementById("root")!).render(
<StrictMode>
<App />