aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-03-20 23:53:39 -0700
committerPinapelz <yukais@pinapelz.com>2026-03-20 23:53:39 -0700
commita36e9e471da0df8433536f7e8c003e1480da4fb3 (patch)
treebce4dc1f8d68be42b445296d90a8bf8f098e3c2e /res
parent3508776583c21785dffc2f0bc9e7dd81c3f08480 (diff)
set default sync to 1 sec, save PW to mem
Diffstat (limited to 'res')
-rw-r--r--res/client.js2
-rw-r--r--res/setup.html27
2 files changed, 18 insertions, 11 deletions
diff --git a/res/client.js b/res/client.js
index eeea7b3..faf13b4 100644
--- a/res/client.js
+++ b/res/client.js
@@ -1392,7 +1392,7 @@ var client_Main = function() {
if(this.host == "") {
this.host = "localhost";
}
- client_Settings.init({ version : 6, uuid : null, name : "", hash : "", chatSize : 300, synchThreshold : 2, isSwapped : false, isUserListHidden : true, latestLinks : [], latestSubs : [], hotkeysEnabled : true, showHintList : true, checkboxes : [], checkedCache : []},$bind(this,this.settingsPatcher));
+ client_Settings.init({ version : 6, uuid : null, name : "", hash : "", chatSize : 300, synchThreshold : 1, isSwapped : false, isUserListHidden : true, latestLinks : [], latestSubs : [], hotkeysEnabled : true, showHintList : true, checkboxes : [], checkedCache : []},$bind(this,this.settingsPatcher));
this.settings = client_Settings.read();
this.initListeners();
this.onTimeGet = new haxe_Timer(this.settings.synchThreshold * 1000);
diff --git a/res/setup.html b/res/setup.html
index 546ee1b..d7a044e 100644
--- a/res/setup.html
+++ b/res/setup.html
@@ -36,26 +36,33 @@
const formElement = document.getElementById("setup-form");
const errorsElement = document.getElementById("form-errors");
+ function submitPassword(pw) {
+ const payload = { password: pw };
+ return fetch("/gate", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload) })
+ .then(res => res.json())
+ .then(response => handleResponse(response, pw))
+ .catch(() => handleResponse(null, pw));
+ }
+
formElement.addEventListener("submit", function (e) {
e.preventDefault();
-
const { password } = formElement.elements;
- const payload = {
- password: password.value,
- };
-
- fetch("/gate", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload) })
- .then(res => res.json())
- .then(response => handleResponse(response))
- .catch(() => handleResponse(null));
+ submitPassword(password.value);
}, true);
- function handleResponse(response) {
+ const savedPassword = localStorage.getItem("gate_password");
+ if (savedPassword) {
+ submitPassword(savedPassword);
+ }
+
+ function handleResponse(response, pw) {
if (response && response.success === true) {
+ localStorage.setItem("gate_password", pw);
window.location.href = "/";
return;
}
+ localStorage.removeItem("gate_password");
showErrors(errorsElement, ["Incorrect password. Not cool man"]);
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage