Compare commits

..

No commits in common. "main" and "v0.5.1" have entirely different histories.
main ... v0.5.1

8
app.py
View file

@ -274,7 +274,6 @@ $("#padname").textContent = "/"+docId+"/";
let ws, ver = 0, clientId = Math.random().toString(36).slice(2), debounce; let ws, ver = 0, clientId = Math.random().toString(36).slice(2), debounce;
let isProtected = false, isAuthed = false; let isProtected = false, isAuthed = false;
const urlPw = new URLSearchParams(location.search).get("pw") || "";
// --- Line numbers --- // --- Line numbers ---
const ta = $("#t"); const ta = $("#t");
@ -383,11 +382,7 @@ function connect(){
updateLockBtn(); updateLockBtn();
if (msg.peers !== undefined) { const el = $("#peers"); el.textContent = msg.peers; el.style.display = "inline"; } if (msg.peers !== undefined) { const el = $("#peers"); el.textContent = msg.peers; el.style.display = "inline"; }
if (isProtected && !isAuthed) { if (isProtected && !isAuthed) {
if (urlPw) { showOverlay();
ws.send(JSON.stringify({type: "auth", password: urlPw}));
} else {
showOverlay();
}
} else { } else {
isAuthed = true; isAuthed = true;
hideOverlay(); hideOverlay();
@ -399,7 +394,6 @@ function connect(){
// Real init with content follows immediately from server // Real init with content follows immediately from server
} else if (msg.type === "error") { } else if (msg.type === "error") {
if (!isAuthed) { if (!isAuthed) {
showOverlay();
const errEl = $("#auth-error"); const errEl = $("#auth-error");
errEl.textContent = msg.message; errEl.textContent = msg.message;
errEl.style.display = "block"; errEl.style.display = "block";