Fix broken contract fetching in user bets list
This commit is contained in:
parent
a85ec472b9
commit
45ffd5a1cc
|
@ -86,8 +86,8 @@ export function BetsList(props: { user: User }) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (bets) {
|
if (bets) {
|
||||||
const contractIds = uniq(bets.map((b) => getContractFromId(b.contractId)))
|
const contractIds = uniq(bets.map((b) => b.contractId))
|
||||||
Promise.all(contractIds).then((contracts) => {
|
Promise.all(contractIds.map(getContractFromId)).then((contracts) => {
|
||||||
setContractsById(keyBy(filterDefined(contracts), 'id'))
|
setContractsById(keyBy(filterDefined(contracts), 'id'))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user