diff --git a/web/pages/fold/[foldSlug]/index.tsx b/web/pages/fold/[foldSlug]/index.tsx index 6912d5b5..5379dddf 100644 --- a/web/pages/fold/[foldSlug]/index.tsx +++ b/web/pages/fold/[foldSlug]/index.tsx @@ -27,9 +27,9 @@ export async function getStaticProps(props: { params: { foldSlug: string } }) { const fold = await getFoldBySlug(foldSlug) const curatorPromise = fold ? getUser(fold.curatorId) : null - const contracts = fold ? await getFoldContracts(fold) : [] + const contracts = fold ? await getFoldContracts(fold).catch((_) => []) : [] const contractComments = await Promise.all( - contracts.map((contract) => listAllComments(contract.id)) + contracts.map((contract) => listAllComments(contract.id).catch((_) => [])) ) const activeContracts = findActiveContracts( @@ -38,7 +38,7 @@ export async function getStaticProps(props: { params: { foldSlug: string } }) { 365 ) const activeContractBets = await Promise.all( - activeContracts.map((contract) => listAllBets(contract.id)) + activeContracts.map((contract) => listAllBets(contract.id).catch((_) => [])) ) const activeContractComments = activeContracts.map( (contract) => diff --git a/web/pages/index.tsx b/web/pages/index.tsx index bfa0a658..5b4048d8 100644 --- a/web/pages/index.tsx +++ b/web/pages/index.tsx @@ -33,10 +33,12 @@ export async function getStaticProps() { const activeContracts = findActiveContracts(contracts, recentComments) const activeContractBets = await Promise.all( - activeContracts.map((contract) => listAllBets(contract.id)) + activeContracts.map((contract) => listAllBets(contract.id).catch((_) => [])) ) const activeContractComments = await Promise.all( - activeContracts.map((contract) => listAllComments(contract.id)) + activeContracts.map((contract) => + listAllComments(contract.id).catch((_) => []) + ) ) return {