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:
parent
a6218df6b2
commit
ba51b3e4d6
1 changed files with 5 additions and 0 deletions
|
|
@ -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};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue