mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-07-17 12:08:47 +02:00
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:
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user