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 => {
dispatch(lbryRedux.doUpdateBalance()).then(() => {
dispatch({
type: lbryRedux.ACTIONS.CLAIM_REWARD_SUCCESS,
data: {
reward: successReward
// Temporary timeout to ensure the sdk has the correct balance after claiming a reward
setTimeout(() => {
dispatch(lbryRedux.doUpdateBalance()).then(() => {
dispatch({
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();
}
});
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);
};
const failure = error => {

39
dist/bundle.js vendored
View file

@ -2186,26 +2186,29 @@ function doClaimRewardType(rewardType) {
});
var success = function success(successReward) {
dispatch(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_1__["doUpdateBalance"])()).then(function () {
dispatch({
type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_SUCCESS,
data: {
reward: successReward
// Temporary timeout to ensure the sdk has the correct balance after claiming a reward
setTimeout(function () {
dispatch(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_1__["doUpdateBalance"])()).then(function () {
dispatch({
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();
}
});
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);
};
var failure = function failure(error) {

View file

@ -71,28 +71,31 @@ export function doClaimRewardType(rewardType, options = {}) {
});
const success = successReward => {
dispatch(doUpdateBalance()).then(() => {
dispatch({
type: ACTIONS.CLAIM_REWARD_SUCCESS,
data: {
reward: successReward,
},
// Temporary timeout to ensure the sdk has the correct balance after claiming a reward
setTimeout(() => {
dispatch(doUpdateBalance()).then(() => {
dispatch({
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 (
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);
};
const failure = error => {