From d6f15deff4fe8450e12bcc7fb465bc870f645b51 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Thu, 17 Feb 2022 01:02:48 -0600 Subject: [PATCH] Fix home page in dev on branches that are not free-response --- web/pages/home.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/pages/home.tsx b/web/pages/home.tsx index 2e37b7fa..1568b778 100644 --- a/web/pages/home.tsx +++ b/web/pages/home.tsx @@ -25,11 +25,15 @@ import { useFollowedFolds } from '../hooks/use-fold' import { SiteLink } from '../components/site-link' export async function getStaticProps() { - const [contracts, folds] = await Promise.all([ + let [contracts, folds] = await Promise.all([ listAllContracts().catch((_) => []), listAllFolds().catch(() => []), ]) + // TODO(James): Remove this line. We are filtering out non-binary contracts so that + // branches other than free-response work. + contracts = contracts.filter((contract) => contract.outcomeType === 'BINARY') + const [contractBets, contractComments] = await Promise.all([ Promise.all(contracts.map((contract) => listAllBets(contract.id))), Promise.all(contracts.map((contract) => listAllComments(contract.id))),