Changes needed for additional youtube transfer UI #62

Merged
neb-b merged 4 commits from onboarding into master 2019-10-07 04:40:02 +02:00
3 changed files with 66 additions and 57 deletions
Showing only changes of commit 44b6373ada - Show all commits

39
dist/bundle.es.js vendored
View file

@ -1626,26 +1626,29 @@ function doClaimRewardType(rewardType, options = {}) {
}); });
const success = successReward => { const success = successReward => {
dispatch(lbryRedux.doUpdateBalance()).then(() => { // Temporary timeout to ensure the sdk has the correct balance after claiming a reward
dispatch({ setTimeout(() => {
type: lbryRedux.ACTIONS.CLAIM_REWARD_SUCCESS, dispatch(lbryRedux.doUpdateBalance()).then(() => {
data: { dispatch({
reward: successReward type: lbryRedux.ACTIONS.CLAIM_REWARD_SUCCESS,
data: {
reward: successReward
}
});
if (successReward.reward_type === rewards.TYPE_NEW_USER && rewards.callbacks.claimFirstRewardSuccess) {
rewards.callbacks.claimFirstRewardSuccess();
} else if (successReward.reward_type === rewards.TYPE_REFERRAL) {
dispatch(doFetchInviteStatus());
}
dispatch(doRewardList());
if (options.callback) {
options.callback();
} }
}); });
}, 1000);
if (successReward.reward_type === rewards.TYPE_NEW_USER && rewards.callbacks.claimFirstRewardSuccess) {
rewards.callbacks.claimFirstRewardSuccess();
} else if (successReward.reward_type === rewards.TYPE_REFERRAL) {
dispatch(doFetchInviteStatus());
}
dispatch(doRewardList());
if (options.callback) {
options.callback();
}
});
}; };
const failure = error => { const failure = error => {

39
dist/bundle.js vendored
View file

@ -2186,26 +2186,29 @@ function doClaimRewardType(rewardType) {
}); });
var success = function success(successReward) { var success = function success(successReward) {
dispatch(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_1__["doUpdateBalance"])()).then(function () { // Temporary timeout to ensure the sdk has the correct balance after claiming a reward
dispatch({ setTimeout(function () {
type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_SUCCESS, dispatch(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_1__["doUpdateBalance"])()).then(function () {
data: { dispatch({
reward: successReward type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_SUCCESS,
data: {
reward: successReward
}
});
if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_NEW_USER && rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess) {
rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess();
} else if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REFERRAL) {
dispatch(Object(redux_actions_user__WEBPACK_IMPORTED_MODULE_4__["doFetchInviteStatus"])());
}
dispatch(doRewardList());
if (options.callback) {
options.callback();
} }
}); });
}, 1000);
if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_NEW_USER && rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess) {
rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess();
} else if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REFERRAL) {
dispatch(Object(redux_actions_user__WEBPACK_IMPORTED_MODULE_4__["doFetchInviteStatus"])());
}
dispatch(doRewardList());
if (options.callback) {
options.callback();
}
});
}; };
var failure = function failure(error) { var failure = function failure(error) {

View file

@ -71,28 +71,31 @@ export function doClaimRewardType(rewardType, options = {}) {
}); });
const success = successReward => { const success = successReward => {
dispatch(doUpdateBalance()).then(() => { // Temporary timeout to ensure the sdk has the correct balance after claiming a reward
dispatch({ setTimeout(() => {
type: ACTIONS.CLAIM_REWARD_SUCCESS, dispatch(doUpdateBalance()).then(() => {
data: { dispatch({
reward: successReward, type: ACTIONS.CLAIM_REWARD_SUCCESS,
}, data: {
reward: successReward,
},
});
if (
successReward.reward_type === rewards.TYPE_NEW_USER &&
rewards.callbacks.claimFirstRewardSuccess
) {
rewards.callbacks.claimFirstRewardSuccess();
} else if (successReward.reward_type === rewards.TYPE_REFERRAL) {
dispatch(doFetchInviteStatus());
}
dispatch(doRewardList());
if (options.callback) {
options.callback();
}
}); });
if ( }, 1000);
successReward.reward_type === rewards.TYPE_NEW_USER &&
rewards.callbacks.claimFirstRewardSuccess
) {
rewards.callbacks.claimFirstRewardSuccess();
} else if (successReward.reward_type === rewards.TYPE_REFERRAL) {
dispatch(doFetchInviteStatus());
}
dispatch(doRewardList());
if (options.callback) {
options.callback();
}
});
}; };
const failure = error => { const failure = error => {