1
0
forked from Kieran/snort

rm custom sw registration, vite-plugin-pwa handles

This commit is contained in:
Martti Malmi 2024-01-10 12:27:30 +02:00
parent b8cdb4bf58
commit 7be4b0bd18
2 changed files with 0 additions and 47 deletions

View File

@ -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();

View File

@ -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();
}
}