From c652ac8ed6c37608d9daba49311f9453e798a421 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 24 Jan 2020 16:09:46 -0500 Subject: [PATCH] add same claim_search releaseTime hack on the homepage --- ui/page/home/view.jsx | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/ui/page/home/view.jsx b/ui/page/home/view.jsx index 42ed76801..a99ff9c6c 100644 --- a/ui/page/home/view.jsx +++ b/ui/page/home/view.jsx @@ -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);