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: {
{amountRedeemed > 0 && ( <> -
+
{amountRedeemed} YES shares and {amountRedeemed} NO shares automatically redeemed for {formatMoney(amountRedeemed)}.
@@ -459,7 +461,7 @@ export function ContractBetsTable(props: { {!isResolved && amountLoaned > 0 && ( <> -
+
You currently have a loan of {formatMoney(amountLoaned)}.
@@ -505,7 +507,6 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) { shares, isSold, isAnte, - loanAmount, } = bet const { isResolved, closeTime, mechanism } = contract