From: Alexander Ebert Date: Mon, 16 May 2022 09:25:55 +0000 (+0200) Subject: Proper handling of a 204 response X-Git-Tag: 5.5.0_Beta_3~20^2^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c521e25a802dc5dd4a0251d4b30056fb9f1d3a81;p=GitHub%2FWoltLab%2FWCF.git Proper handling of a 204 response --- diff --git a/ts/WoltLabSuite/Core/Acp/Ui/DataImport/Manager.ts b/ts/WoltLabSuite/Core/Acp/Ui/DataImport/Manager.ts index 277fe38805..280aabc2d7 100644 --- a/ts/WoltLabSuite/Core/Acp/Ui/DataImport/Manager.ts +++ b/ts/WoltLabSuite/Core/Acp/Ui/DataImport/Manager.ts @@ -10,7 +10,7 @@ import * as Ajax from "../../../Ajax"; import * as Core from "../../../Core"; import * as Language from "../../../Language"; -import { AjaxCallbackObject, AjaxCallbackSetup, ResponseData } from "../../../Ajax/Data"; +import { AjaxCallbackObject, AjaxCallbackSetup } from "../../../Ajax/Data"; import { AjaxResponse } from "../../../Controller/Clipboard/Data"; import { DialogCallbackSetup } from "../../../Ui/Dialog/Data"; import DomUtil from "../../../Dom/Util"; @@ -38,15 +38,7 @@ export class AcpUiDataImportManager implements AjaxCallbackObject { noRedirect: 1, }, silent: true, - failure: (_data: ResponseData, _responseText: string, xhr: XMLHttpRequest) => { - if (xhr.status === 204) { - this.showCompletedDialog(); - - return false; - } - - return true; - }, + success: () => this.showCompletedDialog(), }); } else { this.run(Language.get("wcf.acp.dataImport.data." + this.queue[this.index]), this.queue[this.index]); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/DataImport/Manager.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/DataImport/Manager.js index 630bb7e66a..71dc369ea1 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/DataImport/Manager.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/DataImport/Manager.js @@ -24,13 +24,7 @@ define(["require", "exports", "tslib", "../../../Ajax", "../../../Core", "../../ noRedirect: 1, }, silent: true, - failure: (_data, _responseText, xhr) => { - if (xhr.status === 204) { - this.showCompletedDialog(); - return false; - } - return true; - }, + success: () => this.showCompletedDialog(), }); } else {