From c521e25a802dc5dd4a0251d4b30056fb9f1d3a81 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 16 May 2022 11:25:55 +0200 Subject: [PATCH] Proper handling of a 204 response --- ts/WoltLabSuite/Core/Acp/Ui/DataImport/Manager.ts | 12 ++---------- .../WoltLabSuite/Core/Acp/Ui/DataImport/Manager.js | 8 +------- 2 files changed, 3 insertions(+), 17 deletions(-) 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 { -- 2.20.1