"use client"; import { useEffect } from "react"; /** * Registers the service worker (public/sw.js, APP-1.0-PLAN ยง2): the App's shell and the last * content saved for offline. It never asks for notification permission (no push, decision 13). * Not in development, where Next's own reloading would fight a cache. */ export function RegisterServiceWorker() { useEffect(() => { if (process.env.NODE_ENV !== "production" || !("serviceWorker" in navigator)) return; navigator.serviceWorker.register("/sw.js", { scope: "/" }).catch(() => { // Without it the App still works online; nothing to tell the member. }); }, []); return null; }