- Shorten CTA labels to "Play Demo" / "Load Table" - Fix mismatched corner radii on the hero and table-staging panels - Add horizontal padding to the in-game "insert coin" hint on mobile - Match the 404 page's "TILT" eyebrow label size to the rest of the site - Only register the service worker in production — it precaches /404.html, which doesn't exist as a static file under `next dev` and was failing cache.addAll() on every load Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
19 lines
614 B
TypeScript
19 lines
614 B
TypeScript
"use client";
|
|
|
|
import { useEffect } from "react";
|
|
|
|
export default function RegisterServiceWorker() {
|
|
useEffect(() => {
|
|
// sw.js precaches /404.html, which only exists as a static file after
|
|
// `next build`'s static export — under `next dev` it 404s and fails the
|
|
// whole cache.addAll(), so only register outside of development.
|
|
if (process.env.NODE_ENV !== "production") return;
|
|
if (!("serviceWorker" in navigator)) return;
|
|
navigator.serviceWorker.register("/sw.js").catch((err) => {
|
|
console.error("Service worker registration failed:", err);
|
|
});
|
|
}, []);
|
|
|
|
return null;
|
|
}
|