fix: sw
This commit is contained in:
parent
0ea1cfc8cc
commit
b432535fea
@ -29,7 +29,7 @@ export default function App({ Component }: AppProps) {
|
|||||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
|
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
|
||||||
<meta name="msapplication-TileColor" content="#da532c" />
|
<meta name="msapplication-TileColor" content="#da532c" />
|
||||||
<meta name="theme-color" content="#141218" />
|
<meta name="theme-color" content="#141218" />
|
||||||
<script src="app.js" />
|
<script src="/app.js" type="module" />
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
{`
|
{`
|
||||||
|
@ -1,23 +1,3 @@
|
|||||||
(async function () {
|
|
||||||
console.log("Registering service worker...");
|
|
||||||
if ("serviceWorker" in navigator) {
|
if ("serviceWorker" in navigator) {
|
||||||
try {
|
navigator.serviceWorker.register("/sw.js", { scope: "/" });
|
||||||
const registration = await navigator.serviceWorker.register(
|
|
||||||
"sw.js",
|
|
||||||
{
|
|
||||||
scope: window.location.path,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
if (registration.installing) {
|
|
||||||
console.log("Service worker installing");
|
|
||||||
} else if (registration.waiting) {
|
|
||||||
console.log("Service worker installed");
|
|
||||||
} else if (registration.active) {
|
|
||||||
console.log("Service worker active");
|
|
||||||
}
|
}
|
||||||
console.log(registration);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`Registration failed with ${error}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
@ -14,6 +14,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"theme_color": "#ffffff",
|
"theme_color": "#ffffff",
|
||||||
"background_color": "#ffffff",
|
"background_color": "#141218",
|
||||||
"display": "standalone"
|
"display": "standalone"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user