Fix livestream tiles appearing in Tag Search

## Ticket
155 All live streams show on tag explore/discovery page + content type filters don't work there

`!dynamicRouteProps` wasn't good enough to determine if it's Wild West. Use direct path instead.
This commit is contained in:
infinite-persistence 2021-11-24 17:31:56 +08:00
parent b762cac50b
commit c74dd49bc5
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -75,9 +75,10 @@ function DiscoverPage(props: Props) {
const initialLivestreamTileLimit = getPageSize(DEFAULT_LIVESTREAM_TILE_LIMIT); const initialLivestreamTileLimit = getPageSize(DEFAULT_LIVESTREAM_TILE_LIMIT);
const [showViewMoreLivestreams, setShowViewMoreLivestreams] = React.useState(!dynamicRouteProps); const showLivestreams = window.location.pathname === `/$/${PAGES.WILD_WEST}`;
const livestreamUris = getLivestreamUris(activeLivestreams, channelIds); const [showViewMoreLivestreams, setShowViewMoreLivestreams] = React.useState(showLivestreams);
const useDualList = showViewMoreLivestreams && livestreamUris.length > initialLivestreamTileLimit; const livestreamUris = showLivestreams && getLivestreamUris(activeLivestreams, channelIds);
const useDualList = showViewMoreLivestreams && livestreamUris && livestreamUris.length > initialLivestreamTileLimit;
function getElemMeta() { function getElemMeta() {
return !dynamicRouteProps ? ( return !dynamicRouteProps ? (
@ -167,7 +168,7 @@ function DiscoverPage(props: Props) {
{useDualList && ( {useDualList && (
<> <>
<ClaimListDiscover <ClaimListDiscover
uris={livestreamUris.slice(0, initialLivestreamTileLimit)} uris={livestreamUris && livestreamUris.slice(0, initialLivestreamTileLimit)}
headerLabel={headerLabel} headerLabel={headerLabel}
header={repostedUri ? <span /> : undefined} header={repostedUri ? <span /> : undefined}
tileLayout={repostedUri ? false : tileLayout} tileLayout={repostedUri ? false : tileLayout}