Merge pull request #1455 from dan1d/fix-claiming-reward-modal

Show modal when claiming a reward
This commit is contained in:
Sean Yesmunt 2018-05-09 23:53:02 -04:00 committed by GitHub
commit 4ef8401a35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View file

@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
* Fix price wrapping in price badge ([#1420](https://github.com/lbryio/lbry-app/pull/1420)) * Fix price wrapping in price badge ([#1420](https://github.com/lbryio/lbry-app/pull/1420))
* Fix spacing in search suggestions ([#1422])(https://github.com/lbryio/lbry-app/pull/1422)) * Fix spacing in search suggestions ([#1422])(https://github.com/lbryio/lbry-app/pull/1422))
* Fix text/HTML files don't display correctly in-app anymore ([#1379])(https://github.com/lbryio/lbry-app/issues/1379) * Fix text/HTML files don't display correctly in-app anymore ([#1379])(https://github.com/lbryio/lbry-app/issues/1379)
* Fix notification modals when reward is claimed ([#1436])(https://github.com/lbryio/lbry-app/issues/1436) and ([#1407])(https://github.com/lbryio/lbry-app/issues/1407)
## [0.21.3] - 2018-04-23 ## [0.21.3] - 2018-04-23

View file

@ -1,6 +1,6 @@
import * as ACTIONS from 'constants/action_types'; import * as ACTIONS from 'constants/action_types';
import { MODALS } from 'lbry-redux';
import Lbryio from 'lbryio'; import Lbryio from 'lbryio';
import { doNotify, MODALS } from 'lbry-redux';
import { selectUnclaimedRewardsByType } from 'redux/selectors/rewards'; import { selectUnclaimedRewardsByType } from 'redux/selectors/rewards';
import { selectUserIsRewardApproved } from 'redux/selectors/user'; import { selectUserIsRewardApproved } from 'redux/selectors/user';
import rewards from 'rewards'; import rewards from 'rewards';
@ -40,10 +40,11 @@ export function doClaimRewardType(rewardType) {
} }
if (!userIsRewardApproved && rewardType !== rewards.TYPE_CONFIRM_EMAIL) { if (!userIsRewardApproved && rewardType !== rewards.TYPE_CONFIRM_EMAIL) {
dispatch({ const action = doNotify({
type: ACTIONS.OPEN_MODAL, id: MODALS.REWARD_APPROVAL_REQUIRED,
data: { modal: MODALS.REWARD_APPROVAL_REQUIRED }, isError: false,
}); });
dispatch(action);
return; return;
} }
@ -61,10 +62,11 @@ export function doClaimRewardType(rewardType) {
}, },
}); });
if (successReward.reward_type === rewards.TYPE_NEW_USER) { if (successReward.reward_type === rewards.TYPE_NEW_USER) {
dispatch({ const action = doNotify({
type: ACTIONS.OPEN_MODAL, id: MODALS.FIRST_REWARD,
data: { modal: MODALS.FIRST_REWARD }, isError: false,
}); });
dispatch(action);
} }
}; };