Merge pull request #1637 from lbryio/phone-verify-reward
Fix phone verification + claim first reward
This commit is contained in:
commit
171ea2b97b
2 changed files with 11 additions and 10 deletions
|
@ -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)));
|
||||
};
|
||||
|
|
|
@ -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, {
|
||||
|
|
Loading…
Reference in a new issue