From 134622ea3ade5b2fa6bbb55735948d111561ca9e Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Mon, 14 Nov 2016 18:34:05 +0100 Subject: [PATCH 1/2] Adds error handler in Importer // Import AddressBook #2885 --- js/src/ui/Actionbar/Import/import.js | 34 +++++++++++-- js/src/ui/IdentityName/identityName.js | 12 +++-- js/src/views/Accounts/Summary/summary.js | 56 +++++++++++++++++---- js/src/views/Addresses/addresses.js | 64 +++++++++++++++++++++++- 4 files changed, 146 insertions(+), 20 deletions(-) diff --git a/js/src/ui/Actionbar/Import/import.js b/js/src/ui/Actionbar/Import/import.js index 776e5bb08..081fe1a17 100644 --- a/js/src/ui/Actionbar/Import/import.js +++ b/js/src/ui/Actionbar/Import/import.js @@ -29,6 +29,8 @@ const initialState = { show: false, validate: false, validationBody: null, + error: false, + errorText: '', content: '' }; @@ -65,7 +67,7 @@ export default class ActionbarImport extends Component { renderModal () { const { title, renderValidation } = this.props; - const { show, step } = this.state; + const { show, step, error } = this.state; if (!show) { return null; @@ -73,7 +75,7 @@ export default class ActionbarImport extends Component { const hasSteps = typeof renderValidation === 'function'; - const steps = hasSteps ? [ 'select a file', 'validate' ] : null; + const steps = hasSteps ? [ 'select a file', error ? 'error' : 'validate' ] : null; return ( ); + if (error) { + return [ cancelBtn ]; + } + if (validate) { const confirmBtn = (