Fix "show less livestream" appearing when not needed.
This commit is contained in:
parent
1766b418c6
commit
60198d154e
1 changed files with 3 additions and 2 deletions
|
@ -89,10 +89,11 @@ function DiscoverPage(props: Props) {
|
||||||
const includeLivestreams = !tagsQuery;
|
const includeLivestreams = !tagsQuery;
|
||||||
const [liveSection, setLiveSection] = useState(includeLivestreams ? liveSectionStore : SECTION.HIDDEN);
|
const [liveSection, setLiveSection] = useState(includeLivestreams ? liveSectionStore : SECTION.HIDDEN);
|
||||||
const livestreamUris = includeLivestreams && getLivestreamUris(activeLivestreams, channelIds);
|
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() {
|
function getMeta() {
|
||||||
if (liveSection === SECTION.MORE) {
|
if (liveSection === SECTION.MORE && liveTilesOverLimit) {
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
label={__('Show less livestreams')}
|
label={__('Show less livestreams')}
|
||||||
|
|
Loading…
Reference in a new issue