add back blocked/muted channels to homepage claim_search

This commit is contained in:
Sean Yesmunt 2021-04-24 00:44:42 -04:00
parent 0c71059bf0
commit 7531a2c21a
2 changed files with 10 additions and 1 deletions

View file

@ -2,6 +2,8 @@ import { connect } from 'react-redux';
import { doClaimSearch, selectClaimSearchByQuery, selectFetchingClaimSearchByQuery, SETTINGS } from 'lbry-redux';
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
import { makeSelectClientSetting, selectShowMatureContent } from 'redux/selectors/settings';
import { selectModerationBlockList } from 'redux/selectors/comments';
import { selectMutedChannels } from 'redux/selectors/blocked';
import ClaimListDiscover from './view';
const select = (state) => ({
@ -9,6 +11,8 @@ const select = (state) => ({
fetchingClaimSearchByQuery: selectFetchingClaimSearchByQuery(state),
showNsfw: selectShowMatureContent(state),
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
mutedUris: selectMutedChannels(state),
blockedUris: selectModerationBlockList(state),
});
const perform = {

View file

@ -62,11 +62,16 @@ function ClaimTilesDiscover(props: Props) {
fetchingClaimSearchByQuery,
hasNoSource,
renderProperties,
blockedUris,
mutedUris,
} = props;
const { location } = useHistory();
const urlParams = new URLSearchParams(location.search);
const feeAmountInUrl = urlParams.get('fee_amount');
const feeAmountParam = feeAmountInUrl || feeAmount;
const mutedAndBlockedChannelIds = Array.from(new Set(mutedUris.concat(blockedUris).map((uri) => uri.split('#')[1])));
const options: {
page_size: number,
no_totals: boolean,
@ -95,7 +100,7 @@ function ClaimTilesDiscover(props: Props) {
not_tags: !showNsfw ? MATURE_TAGS : [],
any_languages: languages,
channel_ids: channelIds || [],
not_channel_ids: [],
not_channel_ids: mutedAndBlockedChannelIds,
order_by: orderBy || ['trending_group', 'trending_mixed'],
stream_types: streamTypes === null ? undefined : SIMPLE_SITE ? [CS.FILE_VIDEO, CS.FILE_AUDIO] : undefined,
};