diff --git a/ts/WoltLabSuite/Core/Ajax/Request.ts b/ts/WoltLabSuite/Core/Ajax/Request.ts index dc3978087f1..9eef6c8c280 100644 --- a/ts/WoltLabSuite/Core/Ajax/Request.ts +++ b/ts/WoltLabSuite/Core/Ajax/Request.ts @@ -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(); } @@ -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) { diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js index 58014594e90..dd234cdcaf4 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js @@ -85,15 +85,15 @@ define(["require", "exports", "tslib", "./Status", "../Core", "../Dom/Change/Lis * Dispatches a request, optionally aborting a currently active request. */ sendRequest(abortPrevious) { + if (this._xhr instanceof XMLHttpRequest) { + this._previousXhr = this._xhr; + } if (abortPrevious || this._options.autoAbort) { this.abortPrevious(); } if (!this._options.silent) { 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) {