From 5f355480bb47d3a03aee7b9f29b960b272a38b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Fri, 20 Jul 2018 12:42:47 +0200 Subject: [PATCH] Fix some errors to happen unexpected and make it more clear to user --- .../modals/Receive/steps/03-step-confirm-address.js | 8 +++----- .../modals/Receive/steps/04-step-receive-funds.js | 6 ++++-- src/components/modals/Send/index.js | 12 ++++++++---- src/config/errors.js | 8 ++++++++ src/helpers/deviceAccess.js | 4 +--- 5 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 src/config/errors.js diff --git a/src/components/modals/Receive/steps/03-step-confirm-address.js b/src/components/modals/Receive/steps/03-step-confirm-address.js index 4e496999..6457c7d0 100644 --- a/src/components/modals/Receive/steps/03-step-confirm-address.js +++ b/src/components/modals/Receive/steps/03-step-confirm-address.js @@ -1,6 +1,5 @@ // @flow -import invariant from 'invariant' import styled from 'styled-components' import React, { Fragment, PureComponent } from 'react' @@ -13,9 +12,7 @@ import TranslatedError from '../../../TranslatedError' export default class StepConfirmAddress extends PureComponent { render() { - const { t, device, account, isAddressVerified, verifyAddressError, transitionTo } = this.props - invariant(account, 'No account given') - invariant(device, 'No device given') + const { t, account, isAddressVerified, verifyAddressError, transitionTo } = this.props return ( @@ -34,7 +31,8 @@ export default class StepConfirmAddress extends PureComponent { {t('app:receive.steps.confirmAddress.action')} - {t('app:receive.steps.confirmAddress.text', { currencyName: account.currency.name })} + {account && + t('app:receive.steps.confirmAddress.text', { currencyName: account.currency.name })}