activity, withoutAnteBets: check for undefined
This commit is contained in:
parent
b95dfa0a33
commit
4698d119b4
|
@ -52,10 +52,11 @@ export function listenForUserBets(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function withoutAnteBets(contract: Contract, bets: Bet[]) {
|
export function withoutAnteBets(contract: Contract, bets?: Bet[]) {
|
||||||
const { createdTime } = contract
|
const { createdTime } = contract
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
bets &&
|
||||||
bets.length >= 2 &&
|
bets.length >= 2 &&
|
||||||
bets[0].createdTime === createdTime &&
|
bets[0].createdTime === createdTime &&
|
||||||
bets[1].createdTime === createdTime
|
bets[1].createdTime === createdTime
|
||||||
|
@ -63,5 +64,5 @@ export function withoutAnteBets(contract: Contract, bets: Bet[]) {
|
||||||
return bets.slice(2)
|
return bets.slice(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
return bets
|
return bets ?? []
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ export function ActivityFeed(props: {
|
||||||
<div key={contract.id} className="py-6 px-2 sm:px-4">
|
<div key={contract.id} className="py-6 px-2 sm:px-4">
|
||||||
<ContractFeed
|
<ContractFeed
|
||||||
contract={contract}
|
contract={contract}
|
||||||
bets={contractBets[i]}
|
bets={contractBets[i] ?? []}
|
||||||
comments={contractComments[i]}
|
comments={contractComments[i]}
|
||||||
feedType="activity"
|
feedType="activity"
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user