formatting
This commit is contained in:
parent
8b99bcc6a8
commit
c7b158fd57
8 changed files with 170 additions and 166 deletions
|
|
@ -22,11 +22,11 @@
|
||||||
window.location.href = window.location.href;
|
window.location.href = window.location.href;
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
if (!localStorage["auth"] && new URL(document.all.rcheck.href).password) {
|
if (!localStorage["auth"] && new URL(document.all.rcheck.href).password) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
localStorage["auth"] = 1;
|
localStorage["auth"] = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
import { FaAngleDown } from "react-icons/fa";
|
import { FaAngleDown } from "react-icons/fa";
|
||||||
import { useState, useEffect } from "preact/hooks"
|
import { useState, useEffect } from "preact/hooks";
|
||||||
import { changeTransport } from "../../util/transports.ts";
|
import { changeTransport } from "../../util/transports.ts";
|
||||||
const wispUrl = localStorage.getItem("wispUrl") || (location.protocol === "https:" ? "wss://" : "ws://") + location.host + "/wisp/";
|
const wispUrl =
|
||||||
|
localStorage.getItem("wispUrl") ||
|
||||||
|
(location.protocol === "https:" ? "wss://" : "ws://") +
|
||||||
|
location.host +
|
||||||
|
"/wisp/";
|
||||||
|
|
||||||
interface Option {
|
interface Option {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import "./i18n";
|
||||||
import { setTransport } from "./util/transports";
|
import { setTransport } from "./util/transports";
|
||||||
|
|
||||||
export default function Routes() {
|
export default function Routes() {
|
||||||
if ("serviceWorker" in navigator) {
|
if ("serviceWorker" in navigator) {
|
||||||
window.addEventListener("load", () => {
|
window.addEventListener("load", () => {
|
||||||
navigator.serviceWorker
|
navigator.serviceWorker
|
||||||
.register("/sw.js", {
|
.register("/sw.js", {
|
||||||
|
|
|
||||||
|
|
@ -19,16 +19,16 @@ function uninstallServiceWorkers() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerServiceWorker() {
|
function registerServiceWorker() {
|
||||||
if ('serviceWorker' in navigator) {
|
if ("serviceWorker" in navigator) {
|
||||||
navigator.serviceWorker
|
navigator.serviceWorker
|
||||||
.register("/sw.js", {
|
.register("/sw.js", {
|
||||||
scope: "/~/"
|
scope: "/~/"
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("Service worker registered successfully");
|
console.log("Service worker registered successfully");
|
||||||
setTransport();
|
setTransport();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { updateServiceWorkers, uninstallServiceWorkers, registerServiceWorker };
|
export { updateServiceWorkers, uninstallServiceWorkers, registerServiceWorker };
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue