From 03cda16847d43c90dce184cc80dbe1e5fa72f579 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Tue, 24 Aug 2021 09:42:37 +0800 Subject: [PATCH] Patch: Filter out playlists from main channel listing (#6931) The search wunderbar was lost due to the additional type added --- ui/component/channelContent/view.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/component/channelContent/view.jsx b/ui/component/channelContent/view.jsx index c069428a5..917568b8c 100644 --- a/ui/component/channelContent/view.jsx +++ b/ui/component/channelContent/view.jsx @@ -14,6 +14,8 @@ import { Form, FormField } from 'component/common/form'; import { DEBOUNCE_WAIT_DURATION_MS } from 'constants/search'; import { lighthouse } from 'redux/actions/search'; +const TYPES_TO_ALLOW_FILTER = ['stream', 'repost']; + type Props = { uri: string, totalPages: number, @@ -62,7 +64,11 @@ function ChannelContent(props: Props) { } = useHistory(); const url = `${pathname}${search}`; 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) { const { value } = e.target;