From ba51b3e4d669b92cd9f41cda3562b1b07305c7f1 Mon Sep 17 00:00:00 2001 From: catborise Date: Sat, 24 Oct 2026 22:49:25 +0300 Subject: [PATCH] fix(instances): an address search after the session ends goes to the login form The search's request was sent on to the login page, and the dialog said "The search did not go through. Try again." The page now reloads, which goes to the login form and back to the Instances page after signing in. --- static/js/find_address.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/js/find_address.js b/static/js/find_address.js index ca18a763..cf01bb50 100644 --- a/static/js/find_address.js +++ b/static/js/find_address.js @@ -100,6 +100,11 @@ button.disabled = true; var url = text.url + "?" + new URLSearchParams({q: form.elements.q.value}); fetch(url, {headers: {"X-Requested-With": "XMLHttpRequest"}}).then(function (response) { + if (response.redirected) { + // signed out meanwhile: reloading goes to the login form, then back here + location.reload(); + return new Promise(function () {}); + } return response.json(); }).catch(function () { return {error: text.failed};