diff --git a/web/pages/activity.tsx b/web/pages/activity.tsx index 319dde6c..1934f0af 100644 --- a/web/pages/activity.tsx +++ b/web/pages/activity.tsx @@ -26,7 +26,8 @@ function lastActivityTime(contract: Contract) { // - Market resolved export function findActiveContracts( allContracts: Contract[], - recentComments: Comment[] + recentComments: Comment[], + daysAgo = 3 ) { const idToActivityTime = new Map() function record(contractId: string, time: number) { @@ -40,7 +41,7 @@ export function findActiveContracts( // Find contracts with activity in the last 3 days const DAY_IN_MS = 24 * 60 * 60 * 1000 for (const contract of allContracts || []) { - if (lastActivityTime(contract) > Date.now() - 3 * DAY_IN_MS) { + if (lastActivityTime(contract) > Date.now() - daysAgo * DAY_IN_MS) { contracts.push(contract) record(contract.id, lastActivityTime(contract)) } diff --git a/web/pages/fold/[foldSlug]/index.tsx b/web/pages/fold/[foldSlug]/index.tsx index 647000e8..515f2841 100644 --- a/web/pages/fold/[foldSlug]/index.tsx +++ b/web/pages/fold/[foldSlug]/index.tsx @@ -34,7 +34,8 @@ export async function getStaticProps(props: { params: { foldSlug: string } }) { const activeContracts = findActiveContracts( contracts, - _.flatten(contractComments) + _.flatten(contractComments), + 365 ) const activeContractBets = await Promise.all( activeContracts.map((contract) => listAllBets(contract.id))