diff --git a/packages/app/src/index.tsx b/packages/app/src/index.tsx index 7325a5db..80f63e75 100644 --- a/packages/app/src/index.tsx +++ b/packages/app/src/index.tsx @@ -34,7 +34,6 @@ import SearchPage from "@/Pages/SearchPage"; import SettingsRoutes from "@/Pages/settings/Routes"; import { SubscribeRoutes } from "@/Pages/subscribe"; import ZapPoolPage from "@/Pages/ZapPool"; -import * as serviceWorkerRegistration from "@/serviceWorkerRegistration"; import { System } from "@/system"; import { getCountry, storeRefCode, unwrap } from "@/Utils"; import { LoginStore } from "@/Utils/Login"; @@ -46,8 +45,6 @@ import WalletPage from "./Pages/wallet"; import { WalletReceivePage } from "./Pages/wallet/receive"; import { WalletSendPage } from "./Pages/wallet/send"; -serviceWorkerRegistration.register(); - async function initSite() { console.debug(getCountry()); storeRefCode(); diff --git a/packages/app/src/serviceWorkerRegistration.ts b/packages/app/src/serviceWorkerRegistration.ts deleted file mode 100644 index f9839db2..00000000 --- a/packages/app/src/serviceWorkerRegistration.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Import the service worker with Vite's special syntax -//import ServiceWorkerURL from "./service-worker?worker&url"; - -export function register() { - if ("serviceWorker" in navigator) { - window.addEventListener("load", () => { - //registerValidSW(ServiceWorkerURL); - }); - } -} - -/* -async function registerValidSW(swUrl: string) { - try { - const registration = await navigator.serviceWorker.register(swUrl, - { type: 'module' }); - registration.onupdatefound = () => { - const installingWorker = registration.installing; - if (installingWorker == null) { - return; - } - installingWorker.onstatechange = () => { - if (installingWorker.state === 'installed') { - if (navigator.serviceWorker.controller) { - console.log('Service worker updated, pending reload'); - } else { - console.log('Content is cached for offline use.'); - } - } - }; - }; - } catch (e) { - console.error('Error during service worker registration:', e); - } -} - - */ - -export async function unregister() { - if ("serviceWorker" in navigator) { - const registration = await navigator.serviceWorker.ready; - await registration.unregister(); - } -}