From 45ffd5a1ccbbb318af9814216c427a31fce7127b Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Fri, 12 Aug 2022 20:38:02 -0700 Subject: [PATCH] Fix broken contract fetching in user bets list --- web/components/bets-list.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index 073ba40f..b919cccd 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -86,8 +86,8 @@ export function BetsList(props: { user: User }) { useEffect(() => { if (bets) { - const contractIds = uniq(bets.map((b) => getContractFromId(b.contractId))) - Promise.all(contractIds).then((contracts) => { + const contractIds = uniq(bets.map((b) => b.contractId)) + Promise.all(contractIds.map(getContractFromId)).then((contracts) => { setContractsById(keyBy(filterDefined(contracts), 'id')) }) }