diff --git a/ui/component/channelSelector/index.js b/ui/component/channelSelector/index.js index 9cdc16632..0b353bb4d 100644 --- a/ui/component/channelSelector/index.js +++ b/ui/component/channelSelector/index.js @@ -1,11 +1,10 @@ import { connect } from 'react-redux'; -import { selectMyChannelClaims, makeSelectClaimForUri } from 'lbry-redux'; +import { selectMyChannelClaims } from 'lbry-redux'; import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app'; import { doSetActiveChannel, doSetIncognito } from 'redux/actions/app'; import SelectChannel from './view'; -const select = (state, props) => ({ - claim: makeSelectClaimForUri(props.uri)(state), +const select = state => ({ channels: selectMyChannelClaims(state), activeChannelClaim: selectActiveChannelClaim(state), incognito: selectIncognito(state), diff --git a/ui/component/channelSelector/view.jsx b/ui/component/channelSelector/view.jsx index 424efbdb2..9fd5558d8 100644 --- a/ui/component/channelSelector/view.jsx +++ b/ui/component/channelSelector/view.jsx @@ -10,8 +10,6 @@ import Icon from 'component/common/icon'; import { useHistory } from 'react-router'; type Props = { - uri: string, - claim: ?Claim, selectedChannelUrl: string, // currently selected channel channels: ?Array, onChannelSelect: (url: string) => void, @@ -20,8 +18,6 @@ type Props = { doSetActiveChannel: (string) => void, incognito: boolean, doSetIncognito: (boolean) => void, - activeChanged: boolean, - setActiveChanged: (boolean) => void, }; type ListItemProps = { @@ -56,19 +52,15 @@ function IncognitoSelector(props: IncognitoSelectorProps) { } function ChannelSelector(props: Props) { - const { claim, channels, activeChannelClaim, doSetActiveChannel, hideAnon = false, incognito, doSetIncognito, activeChanged, setActiveChanged } = props; + const { channels, activeChannelClaim, doSetActiveChannel, hideAnon = false, incognito, doSetIncognito } = props; const { push, location: { pathname }, } = useHistory(); - const selectedClaimId = claim && claim.claim_id; - if (selectedClaimId && !activeChanged) doSetActiveChannel(selectedClaimId); - const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url; function handleChannelSelect(channelClaim) { doSetIncognito(false); - setActiveChanged(true); doSetActiveChannel(channelClaim.claim_id); } diff --git a/ui/component/claimMenuList/view.jsx b/ui/component/claimMenuList/view.jsx index e57b64649..fd176e0f9 100644 --- a/ui/component/claimMenuList/view.jsx +++ b/ui/component/claimMenuList/view.jsx @@ -117,10 +117,6 @@ function ClaimMenuList(props: Props) { }); } - function handleAnalytics() { - push(`/$/${PAGES.CREATOR_DASHBOARD}?channel=${encodeURIComponent(permanentUrl)}`); - } - function handleToggleMute() { if (channelIsMuted) { doChannelUnmute(channelUri); @@ -191,22 +187,14 @@ function ClaimMenuList(props: Props) { - - {!incognito && !isRepost && (!claimIsMine ? (!isChannelPage && + {!incognito && !isRepost && !claimIsMine && !isChannelPage && (
{subscriptionLabel}
- ) : ( - -
- - {__('Channel Analytics')} -
-
- ))} + )} {hasExperimentalUi && ( <> diff --git a/ui/page/creatorDashboard/view.jsx b/ui/page/creatorDashboard/view.jsx index d36324508..0a6c838ec 100644 --- a/ui/page/creatorDashboard/view.jsx +++ b/ui/page/creatorDashboard/view.jsx @@ -7,7 +7,6 @@ import Button from 'component/button'; import CreatorAnalytics from 'component/creatorAnalytics'; import ChannelSelector from 'component/channelSelector'; import Yrbl from 'component/yrbl'; -import { useHistory } from 'react-router'; type Props = { channels: Array, @@ -18,10 +17,6 @@ type Props = { export default function CreatorDashboardPage(props: Props) { const { channels, fetchingChannels, activeChannelClaim } = props; const hasChannels = channels && channels.length > 0; - const [activeChanged, setActiveChanged] = React.useState(false); - const { location: { search } } = useHistory(); - const urlParams = new URLSearchParams(search); - const channelParam = urlParams.get('channel'); return ( @@ -45,8 +40,8 @@ export default function CreatorDashboardPage(props: Props) { {!fetchingChannels && activeChannelClaim && ( - - + + )}