rm custom sw registration, vite-plugin-pwa handles
This commit is contained in:
parent
b8cdb4bf58
commit
7be4b0bd18
@ -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();
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user