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 (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({
|
||||
title: 'Recent From Following',
|
||||
link: `/$/${PAGES.CHANNELS_FOLLOWING}`,
|
||||
options: {
|
||||
orderBy: ['release_time'],
|
||||
releaseTime: `>${Math.floor(
|
||||
moment()
|
||||
.subtract(1, 'year')
|
||||
.startOf('week')
|
||||
.unix()
|
||||
)}`,
|
||||
releaseTime: releaseTime,
|
||||
pageSize: subscribedChannels.length > 3 ? 8 : 4,
|
||||
channelIds: subscribedChannels.map(subscription => {
|
||||
const { channelClaimId } = parseURI(subscription.uri);
|
||||
|
|
Loading…
Reference in a new issue