From 47562c21a13ae7417a3a3275e677ac19277c2c24 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Tue, 16 Jun 2020 16:37:35 -0500 Subject: [PATCH] Completed import processing --- src/containers/SkynetImport/SkynetImport.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/containers/SkynetImport/SkynetImport.js b/src/containers/SkynetImport/SkynetImport.js index 5ea288b..4b225fe 100644 --- a/src/containers/SkynetImport/SkynetImport.js +++ b/src/containers/SkynetImport/SkynetImport.js @@ -141,11 +141,17 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon onImportSkylinksReply = (_, arg) => { this.props.notifyApplicationBusy(false); if (arg.data.Success) { - console.log(arg.data.Result); + const failedImportsArray = this.state.imports_array.filter(i => { + return arg.data.Result.failed.includes(i.skylink); + }); this.setState({ - import_text: '', + import_text: failedImportsArray.length > 0 ? JSON.stringify(failedImportsArray, null, 2) : '', imports_array: [], second_stage: false, + }, () => { + if (failedImportsArray.length > 0) { + this.props.notifyError(`Failed to import ${failedImportsArray.length} item(s)`) + } }); } else { this.props.notifyError(arg.data.Error);