From c7df280d6877ff2891a3a795bc8a4bf1f49df0ba Mon Sep 17 00:00:00 2001 From: Anastasia Poupeney Date: Tue, 19 Jun 2018 20:56:28 +0200 Subject: [PATCH] adding separate handle for the error screen and adding skip plus retry for gen check onboarding --- .../Onboarding/steps/GenuineCheck.js | 63 ++++++++++++++----- src/reducers/onboarding.js | 2 + 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/src/components/Onboarding/steps/GenuineCheck.js b/src/components/Onboarding/steps/GenuineCheck.js index 9b1c7b8e..36b93672 100644 --- a/src/components/Onboarding/steps/GenuineCheck.js +++ b/src/components/Onboarding/steps/GenuineCheck.js @@ -82,10 +82,12 @@ class GenuineCheck extends PureComponent { if (!item.pass) { this.setState(INITIAL_STATE) this.props.updateGenuineCheck({ - isGenuineFail: true, - recoveryStepPass: false, + displayErrorScreen: true, pinStepPass: false, + recoveryStepPass: false, + isGenuineFail: false, isDeviceGenuine: false, + genuineCheckUnavailable: null, }) } } @@ -116,6 +118,7 @@ class GenuineCheck extends PureComponent { isGenuineFail: true, isDeviceGenuine: false, genuineCheckUnavailable: null, + displayErrorScreen: true, }) }) } @@ -125,12 +128,13 @@ class GenuineCheck extends PureComponent { this.props.updateGenuineCheck({ isDeviceGenuine: false, genuineCheckUnavailable: error, + displayErrorScreen: false, }) }) } redoGenuineCheck = () => { - this.props.updateGenuineCheck({ isGenuineFail: false }) + this.props.updateGenuineCheck({ displayErrorScreen: false }) } contactSupport = () => { @@ -153,7 +157,7 @@ class GenuineCheck extends PureComponent { const { genuine } = onboarding const { cachedPinStepButton, cachedRecoveryStepButton, isGenuineCheckModalOpened } = this.state - if (genuine.isGenuineFail) { + if (genuine.displayErrorScreen) { return this.renderGenuineFail() } @@ -226,6 +230,14 @@ class GenuineCheck extends PureComponent { ) : genuine.genuineCheckUnavailable ? ( + + {t('app:common.retry')} + @@ -234,9 +246,6 @@ class GenuineCheck extends PureComponent { - - {t('app:common.skipThisStep')} - ) : ( + + + + + + ) : ( + + )} +