feat: add pwa support (#5530)
* feat: add pwa support * fix: deepsource warning * fix: format warning * fix: lint error --------- Co-authored-by: sharpsalat <deniska.xrenov23@yandex.ru>
This commit is contained in:
1 parent
a9ad991892
commit
277a509f49
5 files changed
+49
No files matched your search
@@ -0,0 +1,14 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
|
||||
export const ServiceWorkerRegistration = () => {
|
||||
useEffect(() => {
|
||||
if (!("serviceWorker" in navigator)) return;
|
||||
navigator.serviceWorker.register("/sw.js", { scope: "/", updateViaCache: "none" }).catch((error) => {
|
||||
console.error("Service worker registration failed", error);
|
||||
});
|
||||
}, []);
|
||||
|
||||
return null;
|
||||
};
|
||||
Reference in new issue
Block a user