diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index f9c72ce4..cee7e01d 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -37,7 +37,7 @@ import { resolvedPayout, } from '../../common/calculate' -type BetSort = 'newest' | 'profit' | 'settled' | 'value' +type BetSort = 'newest' | 'profit' | 'resolutionTime' | 'value' | 'closeTime' type BetFilter = 'open' | 'closed' | 'resolved' | 'all' export function BetsList(props: { user: User }) { @@ -108,7 +108,8 @@ export function BetsList(props: { user: User }) { value: (c) => contractsCurrentValue[c.id], newest: (c) => Math.max(...contractBets[c.id].map((bet) => bet.createdTime)), - settled: (c) => c.resolutionTime ?? 0, + resolutionTime: (c) => -(c.resolutionTime ?? c.closeTime ?? Infinity), + closeTime: (c) => -(c.closeTime ?? Infinity), } const displayedContracts = _.sortBy(contracts, SORTS[sort]) .reverse() @@ -173,7 +174,8 @@ export function BetsList(props: { user: User }) { - + + @@ -449,7 +451,7 @@ export function ContractBetsTable(props: {