Skip to content

Commit

Permalink
Fix the order in which the previous XHR is registered
Browse files Browse the repository at this point in the history
  • Loading branch information
dtdesign committed Apr 17, 2024
1 parent f5201fc commit ca409b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions ts/WoltLabSuite/Core/Ajax/Request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ class AjaxRequest {
* Dispatches a request, optionally aborting a currently active request.
*/
sendRequest(abortPrevious?: boolean): void {
if (this._xhr instanceof XMLHttpRequest) {
this._previousXhr = this._xhr;
}

if (abortPrevious || this._options.autoAbort) {
this.abortPrevious();
}
Expand All @@ -116,10 +120,6 @@ class AjaxRequest {
AjaxStatus.show();
}

if (this._xhr instanceof XMLHttpRequest) {
this._previousXhr = this._xhr;
}

this._xhr = new XMLHttpRequest();
this._xhr.open(this._options.type!, this._options.url!, true);
if (this._options.contentType) {
Expand Down
6 changes: 3 additions & 3 deletions wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ca409b3

Please sign in to comment.