lbry-android/app/src/page/firstRun/index.js
2018-11-20 12:07:12 -05:00

28 lines
849 B
JavaScript

import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import {
doGenerateAuthToken,
doUserEmailNew,
selectAuthToken,
selectEmailNewErrorMessage,
selectEmailNewIsPending,
selectEmailToVerify,
selectIsAuthenticating
} from 'lbryinc';
import FirstRun from './view';
const select = (state) => ({
authenticating: selectIsAuthenticating(state),
authToken: selectAuthToken(state),
emailToVerify: selectEmailToVerify(state),
emailNewErrorMessage: selectEmailNewErrorMessage(state),
emailNewPending: selectEmailNewIsPending(state),
});
const perform = dispatch => ({
addUserEmail: email => dispatch(doUserEmailNew(email)),
generateAuthToken: installationId => dispatch(doGenerateAuthToken(installationId)),
notify: data => dispatch(doToast(data))
});
export default connect(select, perform)(FirstRun);