Fix "show less livestream" appearing when not needed.

This commit is contained in:
infinite-persistence 2021-12-15 13:19:22 +08:00
parent 1766b418c6
commit 60198d154e
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -89,10 +89,11 @@ function DiscoverPage(props: Props) {
const includeLivestreams = !tagsQuery;
const [liveSection, setLiveSection] = useState(includeLivestreams ? liveSectionStore : SECTION.HIDDEN);
const livestreamUris = includeLivestreams && getLivestreamUris(activeLivestreams, channelIds);
const useDualList = liveSection === SECTION.LESS && livestreamUris && livestreamUris.length > initialLiveTileLimit;
const liveTilesOverLimit = livestreamUris && livestreamUris.length > initialLiveTileLimit;
const useDualList = liveSection === SECTION.LESS && liveTilesOverLimit;
function getMeta() {
if (liveSection === SECTION.MORE) {
if (liveSection === SECTION.MORE && liveTilesOverLimit) {
return (
<Button
label={__('Show less livestreams')}