diff --git a/src/renderer/component/userPhoneVerify/index.js b/src/renderer/component/userPhoneVerify/index.js index 89b18a120..fea5e2893 100644 --- a/src/renderer/component/userPhoneVerify/index.js +++ b/src/renderer/component/userPhoneVerify/index.js @@ -1,6 +1,6 @@ import React from 'react'; import { connect } from 'react-redux'; -import { doUserPhoneVerify } from 'redux/actions/user'; +import { doUserPhoneVerify, doUserPhoneReset } from 'redux/actions/user'; import { selectPhoneToVerify, selectPhoneVerifyErrorMessage, @@ -15,6 +15,7 @@ const select = state => ({ }); const perform = dispatch => ({ + resetPhone: () => dispatch(doUserPhoneReset()), verifyUserPhone: code => dispatch(doUserPhoneVerify(code)), }); diff --git a/src/renderer/component/userPhoneVerify/view.jsx b/src/renderer/component/userPhoneVerify/view.jsx index 027b18c38..2ee39c1e8 100644 --- a/src/renderer/component/userPhoneVerify/view.jsx +++ b/src/renderer/component/userPhoneVerify/view.jsx @@ -22,13 +22,22 @@ class UserPhoneVerify extends React.PureComponent { this.props.verifyUserPhone(code); } + reset() { + const { resetPhone } = this.props; + resetPhone(); + } + render() { const { cancelButton, phoneErrorMessage, phone, countryCode } = this.props; return (

- Please enter the verification code sent to {`+${countryCode}`} - {phone}. + {__( + `Please enter the verification code sent to +${countryCode}${ + phone + }. Didn't receive it? ` + )} +

{ dispatch({ diff --git a/src/renderer/redux/reducers/user.js b/src/renderer/redux/reducers/user.js index c74428896..870eaee9e 100644 --- a/src/renderer/redux/reducers/user.js +++ b/src/renderer/redux/reducers/user.js @@ -71,6 +71,11 @@ reducers[ACTIONS.USER_PHONE_NEW_SUCCESS] = (state, action) => phoneNewIsPending: false, }); +reducers[ACTIONS.USER_PHONE_RESET] = state => + Object.assign({}, state, { + phoneToVerify: null, + }); + reducers[ACTIONS.USER_PHONE_NEW_FAILURE] = (state, action) => Object.assign({}, state, { phoneNewIsPending: false,