1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-09 03:36:48 +00:00

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.
This commit is contained in:
catborise 2026-10-24 22:49:25 +03:00
parent a6218df6b2
commit ba51b3e4d6

View file

@ -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};