Merge pull request #267 from lbryio/feat-recommendedResultsNoMature

Feat recommended results no mature
This commit is contained in:
Sean Yesmunt 2020-01-29 14:22:22 -05:00 committed by GitHub
commit b4512c25e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

10
dist/bundle.es.js vendored
View file

@ -2220,7 +2220,7 @@ claim => {
return isClaimNsfw(claim);
});
const makeSelectRecommendedContentForUri = uri => reselect.createSelector(makeSelectClaimForUri(uri), selectSearchUrisByQuery, (claim, searchUrisByQuery) => {
const makeSelectRecommendedContentForUri = uri => reselect.createSelector(makeSelectClaimForUri(uri), selectSearchUrisByQuery, makeSelectClaimIsNsfw(uri), (claim, searchUrisByQuery, isMature) => {
const atVanityURI = !uri.includes('#');
let recommendedContent;
@ -2234,9 +2234,11 @@ const makeSelectRecommendedContentForUri = uri => reselect.createSelector(makeSe
return;
}
const searchQuery = getSearchQueryString(title.replace(/\//, ' '), undefined, undefined, {
related_to: claim.claim_id
});
const options = { related_to: claim.claim_id };
if (!isMature) {
options['nsfw'] = false;
}
const searchQuery = getSearchQueryString(title.replace(/\//, ' '), undefined, undefined, options);
let searchUris = searchUrisByQuery[searchQuery];
if (searchUris) {

View file

@ -499,7 +499,8 @@ export const makeSelectRecommendedContentForUri = (uri: string) =>
createSelector(
makeSelectClaimForUri(uri),
selectSearchUrisByQuery,
(claim, searchUrisByQuery) => {
makeSelectClaimIsNsfw(uri),
(claim, searchUrisByQuery, isMature) => {
const atVanityURI = !uri.includes('#');
let recommendedContent;
@ -513,9 +514,11 @@ export const makeSelectRecommendedContentForUri = (uri: string) =>
return;
}
const searchQuery = getSearchQueryString(title.replace(/\//, ' '), undefined, undefined, {
related_to: claim.claim_id,
});
const options = { related_to: claim.claim_id }
if (!isMature) {
options['nsfw'] = false;
}
const searchQuery = getSearchQueryString(title.replace(/\//, ' '), undefined, undefined, options);
let searchUris = searchUrisByQuery[searchQuery];
if (searchUris) {