add same claim_search releaseTime hack on the homepage
This commit is contained in:
parent
e31da33f15
commit
c652ac8ed6
1 changed files with 21 additions and 6 deletions
|
@ -46,17 +46,32 @@ function HomePage(props: Props) {
|
||||||
|
|
||||||
if (showAuthenticatedRows) {
|
if (showAuthenticatedRows) {
|
||||||
if (subscribedChannels && subscribedChannels.length > 0) {
|
if (subscribedChannels && subscribedChannels.length > 0) {
|
||||||
|
let releaseTime = `>${Math.floor(
|
||||||
|
moment()
|
||||||
|
.subtract(1, 'year')
|
||||||
|
.startOf('week')
|
||||||
|
.unix()
|
||||||
|
)}`;
|
||||||
|
|
||||||
|
// Warning - hack below
|
||||||
|
// If users are following more than 20 channels or tags, limit results to stuff less than 6 months old
|
||||||
|
// This helps with timeout issues for users that are following a ton of stuff
|
||||||
|
// https://github.com/lbryio/lbry-sdk/issues/2420
|
||||||
|
if (subscribedChannels.length > 20) {
|
||||||
|
releaseTime = `>${Math.floor(
|
||||||
|
moment()
|
||||||
|
.subtract(6, 'months')
|
||||||
|
.startOf('week')
|
||||||
|
.unix()
|
||||||
|
)}`;
|
||||||
|
}
|
||||||
|
|
||||||
rowData.push({
|
rowData.push({
|
||||||
title: 'Recent From Following',
|
title: 'Recent From Following',
|
||||||
link: `/$/${PAGES.CHANNELS_FOLLOWING}`,
|
link: `/$/${PAGES.CHANNELS_FOLLOWING}`,
|
||||||
options: {
|
options: {
|
||||||
orderBy: ['release_time'],
|
orderBy: ['release_time'],
|
||||||
releaseTime: `>${Math.floor(
|
releaseTime: releaseTime,
|
||||||
moment()
|
|
||||||
.subtract(1, 'year')
|
|
||||||
.startOf('week')
|
|
||||||
.unix()
|
|
||||||
)}`,
|
|
||||||
pageSize: subscribedChannels.length > 3 ? 8 : 4,
|
pageSize: subscribedChannels.length > 3 ? 8 : 4,
|
||||||
channelIds: subscribedChannels.map(subscription => {
|
channelIds: subscribedChannels.map(subscription => {
|
||||||
const { channelClaimId } = parseURI(subscription.uri);
|
const { channelClaimId } = parseURI(subscription.uri);
|
||||||
|
|
Loading…
Reference in a new issue