lbry-desktop/ui/component/headerProfileMenuButton/index.js
infinite-persistence a4d2c6b0a6
Fix: account header doesn't refresh on sign up / log in (#629)
## Issue
Closes 627 account header doesn't refresh on sign up / log in

## Changes
Looking back at "[Header] Changes, fixes and improvements (#493)", noticed that old code was looking at `has_verified_email` instead of just checking whether an email exists. So, restored original code.

This does have a side-effect of the Logout button not showing any email address underneath it immediately after sign up (with the flow cancelled). But I vaguely recall it was that way previously. A refresh cleans it up.

Perhaps another `user/me` when leaving the Sign Up page can make everything in sync, but this PR simpler to test.
2022-01-05 21:56:17 -05:00

17 lines
593 B
JavaScript

import { connect } from 'react-redux';
import { doSignOut } from 'redux/actions/app';
import { selectActiveChannelClaim } from 'redux/selectors/app';
import { selectUserEmail, selectUserVerifiedEmail } from 'redux/selectors/user';
import HeaderProfileMenuButton from './view';
const select = (state) => ({
activeChannelClaim: selectActiveChannelClaim(state),
authenticated: selectUserVerifiedEmail(state),
email: selectUserEmail(state),
});
const perform = (dispatch) => ({
signOut: () => dispatch(doSignOut()),
});
export default connect(select, perform)(HeaderProfileMenuButton);