Fix trades sort by newest
This commit is contained in:
parent
207a12df55
commit
c32442ab41
|
@ -110,7 +110,13 @@ export function BetsList(props: { user: User }) {
|
||||||
)
|
)
|
||||||
} else if (sort === 'value') {
|
} else if (sort === 'value') {
|
||||||
sortedContracts = _.sortBy(contracts, (c) => -contractsCurrentValue[c.id])
|
sortedContracts = _.sortBy(contracts, (c) => -contractsCurrentValue[c.id])
|
||||||
}
|
} else if (sort === 'newest')
|
||||||
|
sortedContracts = _.sortBy(
|
||||||
|
contracts,
|
||||||
|
(c) => -1 * Math.max(...contractBets[c.id].map((bet) => bet.createdTime))
|
||||||
|
)
|
||||||
|
else if (sort === 'resolved')
|
||||||
|
sortedContracts = _.sortBy(contracts, (c) => -1 * (c.resolutionTime ?? 0))
|
||||||
|
|
||||||
const [resolved, unresolved] = _.partition(
|
const [resolved, unresolved] = _.partition(
|
||||||
sortedContracts,
|
sortedContracts,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user