Fix broken contract fetching in user bets list

This commit is contained in:
Marshall Polaris 2022-08-12 20:38:02 -07:00
parent a85ec472b9
commit 45ffd5a1cc

View File

@ -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'))
})
}