From 742110c81c6e25c9d0c7ed6311c31f7b0151c885 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Thu, 29 Apr 2021 17:33:24 +0800 Subject: [PATCH] Homepage|Discover: hide livestreams, then append active livestreams at the top. This essentially hides inactive livestreams from the list. --- ui/component/claimListDiscover/view.jsx | 4 +++- ui/component/claimTilesDiscover/view.jsx | 4 +++- ui/page/channelsFollowing/view.jsx | 1 + ui/page/discover/view.jsx | 1 + ui/page/home/view.jsx | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/component/claimListDiscover/view.jsx b/ui/component/claimListDiscover/view.jsx index e1d9d8844..c82eebc38 100644 --- a/ui/component/claimListDiscover/view.jsx +++ b/ui/component/claimListDiscover/view.jsx @@ -70,6 +70,7 @@ type Props = { showHiddenByUser?: boolean, liveLivestreamsFirst?: boolean, livestreamMap?: { [string]: any }, + hasSource?: boolean, }; function ClaimListDiscover(props: Props) { @@ -123,6 +124,7 @@ function ClaimListDiscover(props: Props) { showHiddenByUser = false, liveLivestreamsFirst, livestreamMap, + hasSource, } = props; const didNavigateForward = history.action === 'PUSH'; const { search } = location; @@ -228,7 +230,7 @@ function ClaimListDiscover(props: Props) { : CS.ORDER_BY_TOP_VALUE, // Sort by top }; - if (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === CS.CLAIM_STREAM)) { + if (hasSource || (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === CS.CLAIM_STREAM))) { options.has_source = true; } diff --git a/ui/component/claimTilesDiscover/view.jsx b/ui/component/claimTilesDiscover/view.jsx index b28d0c620..05c84d752 100644 --- a/ui/component/claimTilesDiscover/view.jsx +++ b/ui/component/claimTilesDiscover/view.jsx @@ -111,6 +111,7 @@ type Props = { timestamp?: string, feeAmount?: string, limitClaimsPerChannel?: number, + hasSource?: boolean, hasNoSource?: boolean, renderProperties?: (Claim) => ?Node, liveLivestreamsFirst?: boolean, @@ -139,6 +140,7 @@ function ClaimTilesDiscover(props: Props) { feeAmount, limitClaimsPerChannel, fetchingClaimSearchByQuery, + hasSource, hasNoSource, renderProperties, blockedUris, @@ -189,7 +191,7 @@ function ClaimTilesDiscover(props: Props) { if (ENABLE_NO_SOURCE_CLAIMS && hasNoSource) { options.has_no_source = true; - } else if (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === 'stream')) { + } else if (hasSource || (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === 'stream'))) { options.has_source = true; } diff --git a/ui/page/channelsFollowing/view.jsx b/ui/page/channelsFollowing/view.jsx index 1a9ddb899..dfd270f48 100644 --- a/ui/page/channelsFollowing/view.jsx +++ b/ui/page/channelsFollowing/view.jsx @@ -47,6 +47,7 @@ function ChannelsFollowingPage(props: Props) { } liveLivestreamsFirst livestreamMap={livestreamMap} + hasSource /> ); diff --git a/ui/page/discover/view.jsx b/ui/page/discover/view.jsx index 5e404d95e..fca41e4fe 100644 --- a/ui/page/discover/view.jsx +++ b/ui/page/discover/view.jsx @@ -152,6 +152,7 @@ function DiscoverPage(props: Props) { } liveLivestreamsFirst livestreamMap={livestreamMap} + hasSource /> ); diff --git a/ui/page/home/view.jsx b/ui/page/home/view.jsx index 3f7bc1007..1c2c1b10e 100644 --- a/ui/page/home/view.jsx +++ b/ui/page/home/view.jsx @@ -93,7 +93,7 @@ function HomePage(props: Props) { )} - + {(route || link) && (