Fix homepage tiles not filtering blocked channels

## Ticket
7165 homepage queries don't take into account blocked channel ids (mute does)

## Changes
resolveSearchOptions: was not grabbing redux data correctly.
This commit is contained in:
infinite-persistence 2021-09-25 13:13:41 +08:00
parent 085d7ad37a
commit 3c0750a2a0
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -20,15 +20,20 @@ import * as CS from 'constants/claim_search';
import ClaimListDiscover from './view'; import ClaimListDiscover from './view';
const select = (state, props) => { const select = (state, props) => {
const showNsfw = selectShowMatureContent(state);
const hideReposts = makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state);
const mutedUris = selectMutedChannels(state);
const blockedUris = selectModerationBlockList(state);
return { return {
claimSearchByQuery: selectClaimSearchByQuery(state), claimSearchByQuery: selectClaimSearchByQuery(state),
claimsByUri: selectClaimsByUri(state), claimsByUri: selectClaimsByUri(state),
fetchingClaimSearchByQuery: selectFetchingClaimSearchByQuery(state), fetchingClaimSearchByQuery: selectFetchingClaimSearchByQuery(state),
showNsfw: selectShowMatureContent(state), showNsfw,
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state), hideReposts,
mutedUris: selectMutedChannels(state), mutedUris,
blockedUris: selectModerationBlockList(state), blockedUris,
options: resolveSearchOptions({ pageSize: 8, ...props }), options: resolveSearchOptions({ showNsfw, hideReposts, mutedUris, blockedUris, pageSize: 8, ...props }),
}; };
}; };
@ -45,14 +50,16 @@ export default withRouter(connect(select, perform)(ClaimListDiscover));
function resolveSearchOptions(props) { function resolveSearchOptions(props) {
const { const {
showNsfw,
hideReposts,
mutedUris,
blockedUris,
location,
pageSize, pageSize,
claimType, claimType,
tags, tags,
showNsfw,
languages, languages,
channelIds, channelIds,
mutedUris,
blockedUris,
orderBy, orderBy,
streamTypes, streamTypes,
hasNoSource, hasNoSource,
@ -60,10 +67,8 @@ function resolveSearchOptions(props) {
releaseTime, releaseTime,
feeAmount, feeAmount,
limitClaimsPerChannel, limitClaimsPerChannel,
hideReposts,
timestamp, timestamp,
claimIds, claimIds,
location,
} = props; } = props;
const mutedAndBlockedChannelIds = Array.from( const mutedAndBlockedChannelIds = Array.from(