Remove blocked and filtered reducers/selectors/actions. #7682

Open
Ruk33 wants to merge 9 commits from 7681-remove-block-list-apis into master
4 changed files with 3 additions and 34 deletions
Showing only changes of commit e3564a2d2b - Show all commits

View file

@ -41,8 +41,6 @@ const select = (state, props) => {
isResolvingUri: collectionUri && selectIsUriResolving(state, collectionUri), isResolvingUri: collectionUri && selectIsUriResolving(state, collectionUri),
thumbnail: getThumbnailFromClaim(claim), thumbnail: getThumbnailFromClaim(claim),
title: collectionUri && selectTitleForUri(state, collectionUri), title: collectionUri && selectTitleForUri(state, collectionUri),
blackListedOutpoints: [],
filteredOutpoints: [],
blockedChannelUris: selectMutedChannels(state), blockedChannelUris: selectMutedChannels(state),
showMature: selectShowMatureContent(state), showMature: selectShowMatureContent(state),
isMature: makeSelectClaimIsNsfw(collectionUri)(state), isMature: makeSelectClaimIsNsfw(collectionUri)(state),

View file

@ -25,14 +25,6 @@ type Props = {
thumbnail?: string, thumbnail?: string,
title?: string, title?: string,
placeholder: boolean, placeholder: boolean,
blackListedOutpoints: Array<{
txid: string,
nout: number,
}>,
filteredOutpoints: Array<{
txid: string,
nout: number,
}>,
blockedChannelUris: Array<string>, blockedChannelUris: Array<string>,
isMature?: boolean, isMature?: boolean,
showMature: boolean, showMature: boolean,

View file

@ -28,7 +28,6 @@ const select = (state, props) => {
page: selectCurrentChannelPage(state), page: selectCurrentChannelPage(state),
claim, claim,
isSubscribed: selectIsSubscribedForUri(state, props.uri), isSubscribed: selectIsSubscribedForUri(state, props.uri),
blackListedOutpoints: [],
subCount: selectSubCountForUri(state, props.uri), subCount: selectSubCountForUri(state, props.uri),
pending: makeSelectClaimIsPending(props.uri)(state), pending: makeSelectClaimIsPending(props.uri)(state),
youtubeChannels: selectYoutubeChannels(state), youtubeChannels: selectYoutubeChannels(state),

View file

@ -50,10 +50,6 @@ type Props = {
channelIsMine: boolean, channelIsMine: boolean,
isSubscribed: boolean, isSubscribed: boolean,
channelIsBlocked: boolean, channelIsBlocked: boolean,
blackListedOutpoints: Array<{
txid: string,
nout: number,
}>,
fetchSubCount: (string) => void, fetchSubCount: (string) => void,
subCount: number, subCount: number,
pending: boolean, pending: boolean,
@ -72,7 +68,6 @@ function ChannelPage(props: Props) {
// page, ?page= may come back some day? // page, ?page= may come back some day?
channelIsMine, channelIsMine,
isSubscribed, isSubscribed,
blackListedOutpoints,
fetchSubCount, fetchSubCount,
subCount, subCount,
pending, pending,
@ -135,14 +130,6 @@ function ChannelPage(props: Props) {
collectionEmpty = <section className="main--empty">{__('No Lists Found')}</section>; collectionEmpty = <section className="main--empty">{__('No Lists Found')}</section>;
} }
let channelIsBlackListed = false;
if (claim && blackListedOutpoints) {
channelIsBlackListed = blackListedOutpoints.some(
(outpoint) => outpoint.txid === claim.txid && outpoint.nout === claim.nout
);
}
// If a user changes tabs, update the url so it stays on the same page if they refresh. // If a user changes tabs, update the url so it stays on the same page if they refresh.
// We don't want to use links here because we can't animate the tab change and using links // We don't want to use links here because we can't animate the tab change and using links
// would alter the Tab label's role attribute, which should stay role="tab" to work with keyboards/screen readers. // would alter the Tab label's role attribute, which should stay role="tab" to work with keyboards/screen readers.
@ -219,9 +206,9 @@ function ChannelPage(props: Props) {
navigate={`/$/${PAGES.CHANNELS}`} navigate={`/$/${PAGES.CHANNELS}`}
/> />
)} )}
{!channelIsBlackListed && <ShareButton uri={uri} />} <ShareButton uri={uri} />
{!(isBlocked || isMuted) && <ClaimSupportButton uri={uri} />} {!(isBlocked || isMuted) && <ClaimSupportButton uri={uri} />}
{!(isBlocked || isMuted) && (!channelIsBlackListed || isSubscribed) && <SubscribeButton uri={permanentUrl} />} {!(isBlocked || isMuted) && isSubscribed && <SubscribeButton uri={permanentUrl} />}
{/* TODO: add channel collections <ClaimCollectionAddButton uri={uri} fileAction /> */} {/* TODO: add channel collections <ClaimCollectionAddButton uri={uri} fileAction /> */}
<ClaimMenuList uri={claim.permanent_url} inline isChannelPage /> <ClaimMenuList uri={claim.permanent_url} inline isChannelPage />
</div> </div>
@ -293,7 +280,6 @@ function ChannelPage(props: Props) {
{currentView === PAGE.CONTENT && ( {currentView === PAGE.CONTENT && (
<ChannelContent <ChannelContent
uri={uri} uri={uri}
channelIsBlackListed={channelIsBlackListed}
viewHiddenChannels viewHiddenChannels
claimType={['stream', 'repost']} claimType={['stream', 'repost']}
empty={<section className="main--empty">{__('No Content Found')}</section>} empty={<section className="main--empty">{__('No Content Found')}</section>}
@ -302,13 +288,7 @@ function ChannelPage(props: Props) {
</TabPanel> </TabPanel>
<TabPanel> <TabPanel>
{currentView === PAGE.LISTS && ( {currentView === PAGE.LISTS && (
<ChannelContent <ChannelContent claimType={'collection'} uri={uri} viewHiddenChannels empty={collectionEmpty} />
claimType={'collection'}
uri={uri}
channelIsBlackListed={channelIsBlackListed}
viewHiddenChannels
empty={collectionEmpty}
/>
)} )}
</TabPanel> </TabPanel>
<TabPanel> <TabPanel>