From e0de8bde945591c85a5528f232cdc18834e4905e Mon Sep 17 00:00:00 2001 From: wearrrrr Date: Tue, 2 Apr 2024 20:54:17 -0500 Subject: [PATCH] Make savedWispUrl and savedBareUrl behave MUCH nicer. --- index.js | 2 +- public/games | 2 +- src/components/SettingsContent/ProxyTab.astro | 4 ++-- src/components/SettingsTablist.astro | 15 ++++++--------- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index d414714..026c01f 100644 --- a/index.js +++ b/index.js @@ -133,7 +133,7 @@ app.use(function (req, res, next) { }); app.use("/custom-favicon", async (req, res) => { try { - const { url, type } = req.query; + const { url } = req.query; const response = await fetch(url).then((apiRes) => apiRes.buffer()); res.send(response); } catch (err) { diff --git a/public/games b/public/games index 8793db1..06285f2 160000 --- a/public/games +++ b/public/games @@ -1 +1 @@ -Subproject commit 8793db1e2fe64cae8936c00bcd4f333f158f6ebd +Subproject commit 06285f2a5abb58ef55e5127424be59cd46a66ae9 diff --git a/src/components/SettingsContent/ProxyTab.astro b/src/components/SettingsContent/ProxyTab.astro index 4b5d1d1..cf40d21 100644 --- a/src/components/SettingsContent/ProxyTab.astro +++ b/src/components/SettingsContent/ProxyTab.astro @@ -62,11 +62,11 @@ const transportsList = [
- +
- +
diff --git a/src/components/SettingsTablist.astro b/src/components/SettingsTablist.astro index 9597b12..c32d4a2 100644 --- a/src/components/SettingsTablist.astro +++ b/src/components/SettingsTablist.astro @@ -303,21 +303,18 @@ const t = i18n.useTranslations(lang); let wispURLInput = document.getElementById("wisp-url-input"); let bareURLInput = document.getElementById("bare-url-input"); let savedSearxngUrl = localStorage.getItem("alu__searxngUrl"); - if (savedSearxngUrl != undefined) { + if (savedSearxngUrl != null) { if (savedSearxngUrl == "") localStorage.setItem("alu__searxngUrl", "https://searxng.site/"); searxngUrlInput.value = localStorage.getItem("alu__searxngUrl"); } + const useWss = location.protocol == "https:"; let savedWispUrl = localStorage.getItem("alu__wispUrl"); - if (savedWispUrl != undefined) { - if (savedWispUrl == "") localStorage.setItem("alu__wispUrl", "wss://aluu.xyz/"); - wispURLInput.value = localStorage.getItem("alu__wispUrl"); - } + if (savedWispUrl == null) localStorage.setItem("alu__wispUrl", useWss ? "wss://" : "ws://" + location.host + "/wisp/"); let savedBareUrl = localStorage.getItem("alu__bareUrl"); - if (savedBareUrl != undefined) { - if (savedBareUrl == "") localStorage.setItem("alu__bareUrl", "https://aluu.xyz/bare/"); - bareURLInput.value = localStorage.getItem("alu__bareUrl"); - } + if (savedBareUrl == null) localStorage.setItem("alu__bareUrl", location.origin + "/bare/") + wispURLInput.value = localStorage.getItem("alu__wispUrl"); + bareURLInput.value = localStorage.getItem("alu__bareUrl"); // Proxy settings applyInputListeners(searxngUrlInput, "alu__searxngUrl"); applyInputListeners(wispURLInput, "alu__wispUrl");