forceReload prevents ajax submission

...instead of weird hacky workarounds forcing refreshes later.
This commit is contained in:
Hugh Rundle
2021-11-25 19:12:03 +11:00
parent b91915d316
commit 5b67226571
4 changed files with 1 additions and 15 deletions

View File

@ -74,7 +74,7 @@ let StatusCache = new class {
// This allows the form to submit in the old fashioned way if there's a problem
if (!trigger || !form) {
if (!trigger || !form || response.headers.get("forceReload")) {
return;
}
@ -90,12 +90,6 @@ let StatusCache = new class {
trigger.removeAttribute('disabled');
})
.then(response => {
if (response.headers.get("forceReload")) {
BookWyrm.addRemoveClass(form, 'is-processing', true);
trigger.setAttribute('disabled', null);
return location.reload();
}
if (!response.ok) {
throw new Error();