mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-31 09:21:27 +00:00
Properly open modals by using notifications.
This commit is contained in:
parent
fc56b9c914
commit
d64a9fc01a
1 changed files with 9 additions and 7 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue