Sort initial bets

This commit is contained in:
James Grugett 2022-02-17 17:39:18 -06:00
parent 3667e81c6f
commit 96ea325136

View File

@ -12,12 +12,11 @@ export const useBets = (contractId: string) => {
return bets return bets
} }
export const useBetsWithoutAntes = ( export const useBetsWithoutAntes = (contract: Contract, initialBets: Bet[]) => {
contract: Contract, const [bets, setBets] = useState<Bet[]>(
initialBets?: Bet[] withoutAnteBets(contract, initialBets).sort(
) => { (bet1, bet2) => bet1.createdTime - bet2.createdTime
const [bets, setBets] = useState<Bet[] | undefined>( )
withoutAnteBets(contract, initialBets)
) )
useEffect(() => { useEffect(() => {