Homepage: show Reposts w/o dups + enable for SIMPLE_SITE
## Issue 5894 Examine re-enabling reposts on odysee homepage ## Changes to `ClaimTilesDiscover` - Add 'remove_duplicates' by default. - Port `forceShowReposts` from `ClaimListsDiscover`. This allows reposts to be shown regardless of the "Hide Reposts" setting, which is locked to "true" for Odysee.
This commit is contained in:
parent
8010b2680a
commit
f8497ad730
2 changed files with 7 additions and 1 deletions
|
@ -90,6 +90,7 @@ type Props = {
|
||||||
doClaimSearch: ({}) => void,
|
doClaimSearch: ({}) => void,
|
||||||
showNsfw: boolean,
|
showNsfw: boolean,
|
||||||
hideReposts: boolean,
|
hideReposts: boolean,
|
||||||
|
forceShowReposts?: boolean,
|
||||||
history: { action: string, push: (string) => void, replace: (string) => void },
|
history: { action: string, push: (string) => void, replace: (string) => void },
|
||||||
claimSearchByQuery: { [string]: Array<string> },
|
claimSearchByQuery: { [string]: Array<string> },
|
||||||
fetchingClaimSearchByQuery: { [string]: boolean },
|
fetchingClaimSearchByQuery: { [string]: boolean },
|
||||||
|
@ -125,6 +126,7 @@ function ClaimTilesDiscover(props: Props) {
|
||||||
claimsByUri,
|
claimsByUri,
|
||||||
showNsfw,
|
showNsfw,
|
||||||
hideReposts,
|
hideReposts,
|
||||||
|
forceShowReposts = false,
|
||||||
// Below are options to pass that are forwarded to claim_search
|
// Below are options to pass that are forwarded to claim_search
|
||||||
tags,
|
tags,
|
||||||
channelIds,
|
channelIds,
|
||||||
|
@ -186,6 +188,8 @@ function ClaimTilesDiscover(props: Props) {
|
||||||
stream_types?: Array<string>,
|
stream_types?: Array<string>,
|
||||||
has_source?: boolean,
|
has_source?: boolean,
|
||||||
has_no_source?: boolean,
|
has_no_source?: boolean,
|
||||||
|
reposted_claim_id?: string,
|
||||||
|
remove_duplicates?: boolean,
|
||||||
} = {
|
} = {
|
||||||
page_size: pageSize,
|
page_size: pageSize,
|
||||||
claim_type: claimType || undefined,
|
claim_type: claimType || undefined,
|
||||||
|
@ -199,6 +203,7 @@ function ClaimTilesDiscover(props: Props) {
|
||||||
not_channel_ids: mutedAndBlockedChannelIds,
|
not_channel_ids: mutedAndBlockedChannelIds,
|
||||||
order_by: orderBy || ['trending_group', 'trending_mixed'],
|
order_by: orderBy || ['trending_group', 'trending_mixed'],
|
||||||
stream_types: streamTypesParam,
|
stream_types: streamTypesParam,
|
||||||
|
remove_duplicates: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ENABLE_NO_SOURCE_CLAIMS && hasNoSource) {
|
if (ENABLE_NO_SOURCE_CLAIMS && hasNoSource) {
|
||||||
|
@ -220,7 +225,7 @@ function ClaimTilesDiscover(props: Props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/lbryio/lbry-desktop/issues/3774
|
// https://github.com/lbryio/lbry-desktop/issues/3774
|
||||||
if (hideReposts) {
|
if (hideReposts && !options.reposted_claim_id && !forceShowReposts) {
|
||||||
if (Array.isArray(options.claim_type)) {
|
if (Array.isArray(options.claim_type)) {
|
||||||
options.claim_type = options.claim_type.filter((claimType) => claimType !== 'repost');
|
options.claim_type = options.claim_type.filter((claimType) => claimType !== 'repost');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -57,6 +57,7 @@ function HomePage(props: Props) {
|
||||||
const claimTiles = (
|
const claimTiles = (
|
||||||
<ClaimTilesDiscover
|
<ClaimTilesDiscover
|
||||||
{...options}
|
{...options}
|
||||||
|
forceShowReposts
|
||||||
liveLivestreamsFirst
|
liveLivestreamsFirst
|
||||||
livestreamMap={livestreamMap}
|
livestreamMap={livestreamMap}
|
||||||
showNoSourceClaims={ENABLE_NO_SOURCE_CLAIMS}
|
showNoSourceClaims={ENABLE_NO_SOURCE_CLAIMS}
|
||||||
|
|
Loading…
Reference in a new issue