Show unresolved markets first in fold

This commit is contained in:
jahooma 2022-01-23 23:55:48 -06:00
parent bc3e43802b
commit 0e3e4b8192

View File

@ -33,11 +33,17 @@ export async function getStaticProps(props: { params: { foldSlug: string } }) {
contracts.map((contract) => listAllComments(contract.id).catch((_) => []))
)
const activeContracts = findActiveContracts(
let activeContracts = findActiveContracts(
contracts,
_.flatten(contractComments),
365
)
const [resolved, unresolved] = _.partition(
activeContracts,
({ isResolved }) => isResolved
)
activeContracts = [...unresolved, ...resolved]
const activeContractBets = await Promise.all(
activeContracts.map((contract) => listAllBets(contract.id).catch((_) => []))
)