This commit is contained in:
2026-02-03 09:58:28 +03:30
parent 87451f3d19
commit 428cba0616
7 changed files with 75 additions and 1962 deletions

View File

@@ -0,0 +1,20 @@
"use client";
import { useEffect } from "react";
export default function ServiceWorkerRegister() {
useEffect(() => {
if ("serviceWorker" in navigator) {
navigator.serviceWorker
.register("/sw.js")
.then((registration) => {
console.log("✅ SW registered:", registration.scope);
})
.catch((error) => {
console.error("❌ SW registration failed:", error);
});
}
}, []);
return null;
}