fix initial reward showing
This commit is contained in:
parent
289bb0b4ae
commit
bab2f7d53c
3 changed files with 16 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import * as modal from "constants/modal_types";
|
||||
import rewards from "rewards.js";
|
||||
import { connect } from "react-redux";
|
||||
import { doUserEmailDecline } from "actions/user";
|
||||
import { doOpenModal } from "actions/app";
|
||||
|
@ -8,13 +9,21 @@ import {
|
|||
selectUserHasEmail,
|
||||
selectUserIsAuthRequested,
|
||||
} from "selectors/user";
|
||||
import { makeSelectHasClaimedReward } from "selectors/rewards";
|
||||
import AuthOverlay from "./view";
|
||||
|
||||
const select = state => ({
|
||||
hasEmail: selectUserHasEmail(state),
|
||||
isPending: selectAuthenticationIsPending(state),
|
||||
isShowing: selectUserIsAuthRequested(state),
|
||||
});
|
||||
const select = (state, props) => {
|
||||
const selectHasClaimed = makeSelectHasClaimedReward();
|
||||
|
||||
return {
|
||||
hasEmail: selectUserHasEmail(state),
|
||||
isPending: selectAuthenticationIsPending(state),
|
||||
isShowing: selectUserIsAuthRequested(state),
|
||||
hasNewUserReward: selectHasClaimed(state, {
|
||||
reward_type: rewards.TYPE_NEW_USER,
|
||||
}),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = dispatch => ({
|
||||
userEmailDecline: () => dispatch(doUserEmailDecline()),
|
||||
|
|
|
@ -18,6 +18,7 @@ export class AuthOverlay extends React.PureComponent {
|
|||
if (
|
||||
this.props.isShowing &&
|
||||
!this.props.isPending &&
|
||||
!nextProps.hasNewUserReward &&
|
||||
!nextProps.isShowing /* && !getLocal("welcome_screen_shown")*/
|
||||
) {
|
||||
setLocal("welcome_screen_shown", true);
|
||||
|
|
|
@ -383,7 +383,7 @@ class PublishPage extends React.PureComponent {
|
|||
});
|
||||
|
||||
this._updateChannelList(newChannelName);
|
||||
}, 5000);
|
||||
}, 10000);
|
||||
},
|
||||
error => {
|
||||
// TODO: better error handling
|
||||
|
|
Loading…
Reference in a new issue