From 863aa03547e6aa8e2f06047de15b05f8e2d5b765 Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Tue, 28 Feb 2017 07:36:12 +0200 Subject: [PATCH] #311: fix newEmail always missed on the 3d step of change email form --- src/components/profile/changeEmail/ChangeEmail.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/profile/changeEmail/ChangeEmail.jsx b/src/components/profile/changeEmail/ChangeEmail.jsx index bd34284..09634ca 100644 --- a/src/components/profile/changeEmail/ChangeEmail.jsx +++ b/src/components/profile/changeEmail/ChangeEmail.jsx @@ -250,7 +250,7 @@ export default class ChangeEmail extends Component { } renderStep2({form, code, isCodeSpecified, isActiveStep}) { - const newEmail = this.props.stepForms[1].value('email'); + const {newEmail} = this.state; return (
@@ -293,10 +293,16 @@ export default class ChangeEmail extends Component { nextStep() { const {activeStep} = this.state; const nextStep = activeStep + 1; + let newEmail = null; + + if (activeStep === 1) { + newEmail = this.props.stepForms[1].value('email'); + } if (nextStep < STEPS_TOTAL) { this.setState({ - activeStep: nextStep + activeStep: nextStep, + newEmail }); this.props.onChangeStep(nextStep);