From feb03314e942f72bbce8256d598be2982c27fb1e Mon Sep 17 00:00:00 2001 From: Tracker-Friendly Date: Tue, 12 Mar 2024 17:55:24 +0000 Subject: [PATCH] Redirects now --- static/js/homeserver.js | 2 +- static/js/login.js | 5 +++++ static/js/signup.js | 5 +++++ templates/homeserver.html | 1 - 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/static/js/homeserver.js b/static/js/homeserver.js index 9d98409..46cd69e 100644 --- a/static/js/homeserver.js +++ b/static/js/homeserver.js @@ -32,7 +32,7 @@ changeButton.addEventListener("click", (event) => { if (response.status == 200) { localStorage.setItem("homeserverURL", remote) - history.back() + window.location.href = document.referrer + "?refresh"; } else if (response.status == 404) { statusBox.innerText = "Not a valid homeserver!" diff --git a/static/js/login.js b/static/js/login.js index a415070..0a42b4a 100644 --- a/static/js/login.js +++ b/static/js/login.js @@ -15,6 +15,11 @@ if (remote == null) { remote = "https://notes.hectabit.org" } +const queryString = window.location.search; +if (queryString == "?redirect") { + location.reload(); +} + let usernameBox = document.getElementById("usernameBox") let passwordBox = document.getElementById("passwordBox") let statusBox = document.getElementById("statusBox") diff --git a/static/js/signup.js b/static/js/signup.js index e2a0221..fff1a52 100644 --- a/static/js/signup.js +++ b/static/js/signup.js @@ -15,6 +15,11 @@ if (remote == null) { remote = "https://notes.hectabit.org" } +const queryString = window.location.search; +if (queryString == "?redirect") { + location.reload(); +} + let usernameBox = document.getElementById("usernameBox") let passwordBox = document.getElementById("passwordBox") let statusBox = document.getElementById("statusBox") diff --git a/templates/homeserver.html b/templates/homeserver.html index 841f235..0a5e5d5 100644 --- a/templates/homeserver.html +++ b/templates/homeserver.html @@ -16,7 +16,6 @@ background-size: 312px } .inoutdiv { - background-color: #fff; border-radius: 8px; }