From b43593a996671ac0eb003bb2fca2b19001e96643 Mon Sep 17 00:00:00 2001 From: Franco Montenegro Date: Thu, 7 Jan 2021 12:19:33 -0300 Subject: [PATCH] When a new reward is acquired, only close modals if the reward comes from reward_code --- ui/index.jsx | 6 ++++-- ui/rewards.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/index.jsx b/ui/index.jsx index f74b4f5ca..2760d6d1e 100644 --- a/ui/index.jsx +++ b/ui/index.jsx @@ -135,8 +135,10 @@ rewards.setCallback('claimFirstRewardSuccess', () => { app.store.dispatch(doOpenModal(MODALS.FIRST_REWARD)); }); -rewards.setCallback('claimRewardSuccess', () => { - app.store.dispatch(doHideModal()); +rewards.setCallback('claimRewardSuccess', reward => { + if (reward && reward.type === rewards.TYPE_REWARD_CODE) { + app.store.dispatch(doHideModal()); + } }); // @if TARGET='app' diff --git a/ui/rewards.js b/ui/rewards.js index 944af8143..95e445ec7 100644 --- a/ui/rewards.js +++ b/ui/rewards.js @@ -38,7 +38,7 @@ rewards.claimReward = (type, rewardParams) => { window.store.dispatch(action); if (rewards.callbacks.claimRewardSuccess) { - rewards.callbacks.claimRewardSuccess(); + rewards.callbacks.claimRewardSuccess(reward); } resolve(reward);