Fix home page in dev on branches that are not free-response

This commit is contained in:
James Grugett 2022-02-17 01:02:48 -06:00
parent 482a72f4e1
commit d6f15deff4

View File

@ -25,11 +25,15 @@ import { useFollowedFolds } from '../hooks/use-fold'
import { SiteLink } from '../components/site-link' import { SiteLink } from '../components/site-link'
export async function getStaticProps() { export async function getStaticProps() {
const [contracts, folds] = await Promise.all([ let [contracts, folds] = await Promise.all([
listAllContracts().catch((_) => []), listAllContracts().catch((_) => []),
listAllFolds().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([ const [contractBets, contractComments] = await Promise.all([
Promise.all(contracts.map((contract) => listAllBets(contract.id))), Promise.all(contracts.map((contract) => listAllBets(contract.id))),
Promise.all(contracts.map((contract) => listAllComments(contract.id))), Promise.all(contracts.map((contract) => listAllComments(contract.id))),