Format settings code nicer and run prettier

This commit is contained in:
wearrrrr 2024-07-28 22:31:52 -05:00
parent 33e80ef1eb
commit 90e5bbb7f2
4 changed files with 257 additions and 267 deletions

View file

@ -32,9 +32,7 @@ module.exports = {
project: "./tsconfig.json",
},
plugins: ["@typescript-eslint"],
extends: [
"plugin:@typescript-eslint/recommended",
],
extends: ["plugin:@typescript-eslint/recommended"],
},
{
// Define the configuration for `<script>` tag.

View file

@ -66,7 +66,6 @@ export async function registerAndUpdateSW(): Promise<void> {
}
}
export async function initTransport() {
await TransportMgr.setTransport(TransportMgr.getTransport(), localStorage.getItem("alu__wispUrl") || wispURLDefault);
}

View file

@ -60,7 +60,6 @@ export function getStaticPaths() {
</div>
</div>
</section>
<script src="@components/ts/WispServerTiming.ts"></script>
</main>
<ProxyRegistrar />
<script>

View file

@ -73,7 +73,7 @@ export function getStaticPaths() {
loadContent(event.target.id);
});
});
}
function loadContent(tabID) {
if (window.currentlySelectedTab == tabID) return;
else window.currentlySelectedTab = tabID;
@ -339,10 +339,6 @@ export function getStaticPaths() {
if (savedSearxngUrl == "") localStorage.setItem("alu__searxngUrl", "https://searxng.site/");
searxngUrlInput.value = localStorage.getItem("alu__searxngUrl");
}
// const useWss = location.protocol == "https:";
// const webSocketProtocol = useWss ? "wss://" : "ws://";
// let savedWispUrl = localStorage.getItem("alu__wispUrl");
// if (savedWispUrl == null || savedWispUrl == "") localStorage.setItem("alu__wispUrl", webSocketProtocol + location.host + "/wisp/");
const savedBareUrl = localStorage.getItem("alu__bareUrl");
if (savedBareUrl == null || savedBareUrl == "") localStorage.setItem("alu__bareUrl", location.origin + "/bare/");
@ -364,7 +360,7 @@ export function getStaticPaths() {
}
function checkSearxng() {
// This function checks if the "searxng" option was clicked, display an additional option if so.
// Callback for search engine dropdown
const search_engine = JSON.parse(localStorage.getItem("alu__search_engine"));
if (search_engine) {
if (search_engine.value.toLowerCase() == "searx") {
@ -380,15 +376,13 @@ export function getStaticPaths() {
function navigateToNewLangaugePage() {
const value = JSON.parse(localStorage.getItem("alu__selectedLanguage")).value;
const currentLanguage = window.location.pathname.split("/")[1];
// Do nothing.. because we're already on the page.
if (value == currentLanguage) return;
window.location.href = `/${value}/settings`;
}
}
document.addEventListener("astro:after-swap", () => {
setTimeout(() => {
settingsLoad();
}, 300);
}, 200);
});
settingsLoad();
</script>