Patch: Filter out playlists from main channel listing (#6931)

The search wunderbar was lost due to the additional type added
This commit is contained in:
infinite-persistence 2021-08-24 09:42:37 +08:00
parent d8c2a8f5bf
commit 03cda16847
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -14,6 +14,8 @@ import { Form, FormField } from 'component/common/form';
import { DEBOUNCE_WAIT_DURATION_MS } from 'constants/search'; import { DEBOUNCE_WAIT_DURATION_MS } from 'constants/search';
import { lighthouse } from 'redux/actions/search'; import { lighthouse } from 'redux/actions/search';
const TYPES_TO_ALLOW_FILTER = ['stream', 'repost'];
type Props = { type Props = {
uri: string, uri: string,
totalPages: number, totalPages: number,
@ -62,7 +64,11 @@ function ChannelContent(props: Props) {
} = useHistory(); } = useHistory();
const url = `${pathname}${search}`; const url = `${pathname}${search}`;
const claimId = claim && claim.claim_id; const claimId = claim && claim.claim_id;
const showFilters = !claimType || claimType === 'stream'; const showFilters =
!claimType ||
(Array.isArray(claimType)
? claimType.every((ct) => TYPES_TO_ALLOW_FILTER.includes(ct))
: TYPES_TO_ALLOW_FILTER.includes(claimType));
function handleInputChange(e) { function handleInputChange(e) {
const { value } = e.target; const { value } = e.target;