Fix null active channel case (#918)

This commit is contained in:
saltrafael 2022-02-18 14:22:21 -03:00 committed by GitHub
parent 56f8d8b71a
commit 178dec7030
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,8 +21,11 @@ type HeaderMenuButtonProps = {
export default function HeaderProfileMenuButton(props: HeaderMenuButtonProps) {
const { myChannelClaimIds, activeChannelClaim, authenticated, email, signOut } = props;
const pendingChannelFetch = myChannelClaimIds === undefined;
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;
return (
<div className="header__buttons">