diff --git a/src/renderer/redux/actions/user.js b/src/renderer/redux/actions/user.js index 92d232a40..dcd074c7d 100644 --- a/src/renderer/redux/actions/user.js +++ b/src/renderer/redux/actions/user.js @@ -1,6 +1,6 @@ import * as ACTIONS from 'constants/action_types'; import Lbryio from 'lbryio'; -import { Lbry, doNotify, MODALS } from 'lbry-redux'; +import { Lbry, doNotify, MODALS, doHideNotification } from 'lbry-redux'; import { doClaimRewardType, doRewardList } from 'redux/actions/rewards'; import { selectEmailToVerify, @@ -163,13 +163,15 @@ export function doUserPhoneVerify(verificationCode) { }, 'post' ) - .then(() => { - dispatch({ - type: ACTIONS.USER_PHONE_VERIFY_SUCCESS, - data: { phone_number: phoneNumber }, - }); - dispatch(doUserFetch()); - dispatch(doClaimRewardType(rewards.TYPE_NEW_USER)); + .then(user => { + if (user.is_identity_verified) { + dispatch({ + type: ACTIONS.USER_PHONE_VERIFY_SUCCESS, + data: { user }, + }); + dispatch(doHideNotification()); + dispatch(doClaimRewardType(rewards.TYPE_NEW_USER)); + } }) .catch(error => dispatch(doUserPhoneVerifyFailure(error))); }; diff --git a/src/renderer/redux/reducers/user.js b/src/renderer/redux/reducers/user.js index b9b567ffe..aade82c69 100644 --- a/src/renderer/redux/reducers/user.js +++ b/src/renderer/redux/reducers/user.js @@ -88,13 +88,12 @@ reducers[ACTIONS.USER_PHONE_VERIFY_STARTED] = state => phoneVerifyErrorMessage: '', }); -reducers[ACTIONS.USER_PHONE_VERIFY_SUCCESS] = (state, action) => { +reducers[ACTIONS.USER_PHONE_VERIFY_SUCCESS] = (state, action) => Object.assign({}, state, { phoneToVerify: '', phoneVerifyIsPending: false, user: action.data.user, }); -}; reducers[ACTIONS.USER_PHONE_VERIFY_FAILURE] = (state, action) => Object.assign({}, state, {