Sort initial bets
This commit is contained in:
		
							parent
							
								
									3667e81c6f
								
							
						
					
					
						commit
						96ea325136
					
				| 
						 | 
					@ -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(() => {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user