disable register sw

This commit is contained in:
Rama Priyanto 2025-05-26 13:39:00 +07:00
parent 3d9975cbcb
commit 5c430a9733
1 changed files with 22 additions and 22 deletions

View File

@ -1,25 +1,25 @@
"use client";
// "use client";
import { useEffect } from "react";
// import { useEffect } from "react";
export function RegisterSW() {
useEffect(() => {
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker
.register("/sw.js")
.then((registration) => {
console.log("Service Worker registered: ", registration);
})
.catch((registrationError) => {
console.log(
"Service Worker registration failed: ",
registrationError
);
});
});
}
}, []);
// export function RegisterSW() {
// useEffect(() => {
// if ("serviceWorker" in navigator) {
// window.addEventListener("load", () => {
// navigator.serviceWorker
// .register("/sw.js")
// .then((registration) => {
// console.log("Service Worker registered: ", registration);
// })
// .catch((registrationError) => {
// console.log(
// "Service Worker registration failed: ",
// registrationError
// );
// });
// });
// }
// }, []);
return null;
}
// return null;
// }