From 1fc2a7b8c7699c35d4f64edfe6f0ba102b4a7912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Fri, 10 Jul 2026 13:38:35 +0200 Subject: [PATCH] Remove onReportImportError handler from TaskComponent Setting the onReportImportError handler may result in an unexpected behavior of the ReportImportDialog because it would close despite of an error occurred and maybe no error is displayed. Therefore it is better to always let the dialog handle and display the error by removing the callback prop completely. --- src/web/pages/tasks/TaskComponent.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/web/pages/tasks/TaskComponent.tsx b/src/web/pages/tasks/TaskComponent.tsx index fc14e518fb..56a8f84785 100644 --- a/src/web/pages/tasks/TaskComponent.tsx +++ b/src/web/pages/tasks/TaskComponent.tsx @@ -135,7 +135,6 @@ interface TaskComponentProps { onModifyTaskWizardError?: (error: Error) => void; onModifyTaskWizardSaved?: () => void; onReportImported?: () => void; - onReportImportError?: (error: Error) => void; onResumed?: (response: Response) => void; onResumeError?: (error: Error) => void; onSaved?: () => void; @@ -169,7 +168,6 @@ const TaskComponent = ({ onModifyTaskWizardError, onModifyTaskWizardSaved, onReportImported, - onReportImportError, onResumed, onResumeError, onSaved, @@ -939,11 +937,10 @@ const TaskComponent = ({ setReportImportDialogVisible(false); }; - const handleReportImport = (data: ReportImportDialogData) => { - return gmp.report - .import(data) - .then(onReportImported, onReportImportError) - .then(() => closeReportImportDialog()); + const handleReportImport = async (data: ReportImportDialogData) => { + await gmp.report.import(data); + onReportImported?.(); + closeReportImportDialog(); }; const handleScanConfigChange = (configId?: string) => {