fetchUser refresh on rewards header
This commit is contained in:
parent
194464bd71
commit
8b0b69d7dc
2 changed files with 12 additions and 2 deletions
|
@ -1,5 +1,12 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { selectFetchingRewards, selectUnclaimedRewards, selectClaimedRewards, selectUser, doRewardList } from 'lbryinc';
|
import {
|
||||||
|
selectFetchingRewards,
|
||||||
|
selectUnclaimedRewards,
|
||||||
|
selectClaimedRewards,
|
||||||
|
selectUser,
|
||||||
|
doRewardList,
|
||||||
|
doUserFetch,
|
||||||
|
} from 'lbryinc';
|
||||||
import { selectDaemonSettings } from 'redux/selectors/settings';
|
import { selectDaemonSettings } from 'redux/selectors/settings';
|
||||||
import RewardsPage from './view';
|
import RewardsPage from './view';
|
||||||
|
|
||||||
|
@ -13,6 +20,7 @@ const select = state => ({
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
fetchRewards: () => dispatch(doRewardList()),
|
fetchRewards: () => dispatch(doRewardList()),
|
||||||
|
fetchUser: () => dispatch(doUserFetch()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { rewards as REWARD_TYPES } from 'lbryinc';
|
||||||
type Props = {
|
type Props = {
|
||||||
doAuth: () => void,
|
doAuth: () => void,
|
||||||
fetchRewards: () => void,
|
fetchRewards: () => void,
|
||||||
|
fetchUser: () => void,
|
||||||
fetching: boolean,
|
fetching: boolean,
|
||||||
rewards: Array<Reward>,
|
rewards: Array<Reward>,
|
||||||
claimed: Array<Reward>,
|
claimed: Array<Reward>,
|
||||||
|
@ -31,7 +32,7 @@ class RewardsPage extends PureComponent<Props> {
|
||||||
this.props.fetchRewards();
|
this.props.fetchRewards();
|
||||||
}
|
}
|
||||||
renderPageHeader() {
|
renderPageHeader() {
|
||||||
const { user, daemonSettings } = this.props;
|
const { user, daemonSettings, fetchUser } = this.props;
|
||||||
|
|
||||||
if (user && !user.is_reward_approved && daemonSettings && daemonSettings.share_usage_data) {
|
if (user && !user.is_reward_approved && daemonSettings && daemonSettings.share_usage_data) {
|
||||||
if (!user.primary_email || !user.has_verified_email || !user.is_identity_verified) {
|
if (!user.primary_email || !user.has_verified_email || !user.is_identity_verified) {
|
||||||
|
@ -69,6 +70,7 @@ class RewardsPage extends PureComponent<Props> {
|
||||||
</p>
|
</p>
|
||||||
<div className="card__actions">
|
<div className="card__actions">
|
||||||
<Button navigate="/" button="primary" label="Return Home" />
|
<Button navigate="/" button="primary" label="Return Home" />
|
||||||
|
<Button onClick={() => fetchUser()} button="link" label="Refresh" />
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue