FIX: Avoid error on ajax.abort() when client has not opened the request.

This commit is contained in:
Guo Xiang Tan 2019-03-29 15:37:22 +08:00
parent 8cfd887f33
commit a6d93f6317

View File

@ -105,6 +105,8 @@ export function ajax() {
};
args.error = (xhr, textStatus, errorThrown) => {
// 0 represents the `UNSENT` state
if (xhr.readyState === 0) return;
handleLogoff(xhr);
// note: for bad CSRF we don't loop an extra request right away.