From adc3c068037b9b1b07f2d7b5a7604abb2502113d Mon Sep 17 00:00:00 2001 From: Rafael Date: Mon, 9 May 2022 08:05:29 -0300 Subject: [PATCH] Fix header icon active channel --- ui/component/headerProfileMenuButton/index.js | 10 +++++----- ui/component/headerProfileMenuButton/view.jsx | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/component/headerProfileMenuButton/index.js b/ui/component/headerProfileMenuButton/index.js index 92de173e4..08515f9c9 100644 --- a/ui/component/headerProfileMenuButton/index.js +++ b/ui/component/headerProfileMenuButton/index.js @@ -1,19 +1,19 @@ import { connect } from 'react-redux'; import { doSignOut } from 'redux/actions/app'; -import { selectDefaultChannelClaim } from 'redux/selectors/settings'; +import { selectActiveChannelClaim } from 'redux/selectors/app'; import { selectMyChannelClaimIds } from 'redux/selectors/claims'; import { selectUserEmail, selectUserVerifiedEmail } from 'redux/selectors/user'; import HeaderProfileMenuButton from './view'; const select = (state) => ({ myChannelClaimIds: selectMyChannelClaimIds(state), - defaultChannelClaim: selectDefaultChannelClaim(state), + activeChannelClaim: selectActiveChannelClaim(state), authenticated: selectUserVerifiedEmail(state), email: selectUserEmail(state), }); -const perform = (dispatch) => ({ - signOut: () => dispatch(doSignOut()), -}); +const perform = { + signOut: doSignOut, +}; export default connect(select, perform)(HeaderProfileMenuButton); diff --git a/ui/component/headerProfileMenuButton/view.jsx b/ui/component/headerProfileMenuButton/view.jsx index ca3143ac4..8d13cb6ee 100644 --- a/ui/component/headerProfileMenuButton/view.jsx +++ b/ui/component/headerProfileMenuButton/view.jsx @@ -18,21 +18,21 @@ import Button from 'component/button'; type HeaderMenuButtonProps = { myChannelClaimIds: ?Array, - defaultChannelClaim: ?ChannelClaim, + activeChannelClaim: ?ChannelClaim, authenticated: boolean, email: ?string, signOut: () => void, }; export default function HeaderProfileMenuButton(props: HeaderMenuButtonProps) { - const { myChannelClaimIds, defaultChannelClaim, authenticated, email, signOut } = props; + const { myChannelClaimIds, activeChannelClaim, authenticated, email, signOut } = props; const [anchorEl, setAnchorEl] = React.useState(null); const open = Boolean(anchorEl); const handleClick = (event) => setAnchorEl(!anchorEl ? event.currentTarget : null); const handleClose = () => setAnchorEl(null); - const activeChannelUrl = defaultChannelClaim && defaultChannelClaim.permanent_url; + const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url; // activeChannel will be: undefined = fetching, null = nothing, or { channel claim } const noActiveChannel = activeChannelUrl === null; const pendingChannelFetch = !noActiveChannel && myChannelClaimIds === undefined;