disable register sw
This commit is contained in:
parent
3d9975cbcb
commit
5c430a9733
|
|
@ -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;
|
||||
// }
|
||||
|
|
|
|||
Loading…
Reference in New Issue