When a new reward is acquired, only close modals if the reward comes from reward_code

This commit is contained in:
Franco Montenegro 2021-01-07 12:19:33 -03:00 committed by Sean Yesmunt
parent c09a7e8bbc
commit b43593a996
2 changed files with 5 additions and 3 deletions

View file

@ -135,8 +135,10 @@ rewards.setCallback('claimFirstRewardSuccess', () => {
app.store.dispatch(doOpenModal(MODALS.FIRST_REWARD)); app.store.dispatch(doOpenModal(MODALS.FIRST_REWARD));
}); });
rewards.setCallback('claimRewardSuccess', () => { rewards.setCallback('claimRewardSuccess', reward => {
if (reward && reward.type === rewards.TYPE_REWARD_CODE) {
app.store.dispatch(doHideModal()); app.store.dispatch(doHideModal());
}
}); });
// @if TARGET='app' // @if TARGET='app'

View file

@ -38,7 +38,7 @@ rewards.claimReward = (type, rewardParams) => {
window.store.dispatch(action); window.store.dispatch(action);
if (rewards.callbacks.claimRewardSuccess) { if (rewards.callbacks.claimRewardSuccess) {
rewards.callbacks.claimRewardSuccess(); rewards.callbacks.claimRewardSuccess(reward);
} }
resolve(reward); resolve(reward);