paginates over search count rather than channel claim count #3271
2 changed files with 10 additions and 10 deletions
|
@ -1,23 +1,23 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { makeSelectNsfwCountForChannel, makeSelectNsfwCountFromUris, parseURI } from 'lbry-redux';
|
||||
import { makeSelectNsfwCountFromUris, makeSelectOmittedCountForChannel, parseURI } from 'lbry-redux';
|
||||
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import HiddenNsfwClaims from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
const { uri, uris } = props;
|
||||
|
||||
let numberOfNsfwClaims;
|
||||
let numberOfHiddenClaims;
|
||||
if (uri) {
|
||||
const { isChannel } = parseURI(uri);
|
||||
numberOfNsfwClaims = isChannel
|
||||
? makeSelectNsfwCountForChannel(uri)(state)
|
||||
numberOfHiddenClaims = isChannel
|
||||
? makeSelectOmittedCountForChannel(uri)(state)
|
||||
: makeSelectNsfwCountFromUris([uri])(state);
|
||||
} else if (uris) {
|
||||
numberOfNsfwClaims = makeSelectNsfwCountFromUris(uris)(state);
|
||||
numberOfHiddenClaims = makeSelectNsfwCountFromUris(uris)(state);
|
||||
}
|
||||
|
||||
return {
|
||||
numberOfNsfwClaims,
|
||||
numberOfHiddenClaims,
|
||||
obscureNsfw: !selectShowMatureContent(state),
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,19 +3,19 @@ import React from 'react';
|
|||
import Button from 'component/button';
|
||||
|
||||
type Props = {
|
||||
numberOfNsfwClaims: number,
|
||||
numberOfHiddenClaims: number,
|
||||
obscureNsfw: boolean,
|
||||
className: ?string,
|
||||
};
|
||||
|
||||
export default (props: Props) => {
|
||||
const { numberOfNsfwClaims, obscureNsfw } = props;
|
||||
const { numberOfHiddenClaims, obscureNsfw } = props;
|
||||
|
||||
return (
|
||||
obscureNsfw &&
|
||||
Boolean(numberOfNsfwClaims) && (
|
||||
Boolean(numberOfHiddenClaims) && (
|
||||
<div className="section--padded section__subtitle">
|
||||
{numberOfNsfwClaims} {numberOfNsfwClaims > 1 ? __('files') : __('file')} {__('hidden due to your')}{' '}
|
||||
{numberOfHiddenClaims} {numberOfHiddenClaims > 1 ? __('files') : __('file')} {__('hidden due to your')}{' '}
|
||||
<Button button="link" navigate="/$/settings" label={__('content viewing preferences')} />.
|
||||
</div>
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue