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
}
export const useBetsWithoutAntes = (
contract: Contract,
initialBets?: Bet[]
) => {
const [bets, setBets] = useState<Bet[] | undefined>(
withoutAnteBets(contract, initialBets)
export const useBetsWithoutAntes = (contract: Contract, initialBets: Bet[]) => {
const [bets, setBets] = useState<Bet[]>(
withoutAnteBets(contract, initialBets).sort(
(bet1, bet2) => bet1.createdTime - bet2.createdTime
)
)
useEffect(() => {