Fix a case of limit order sorting
This commit is contained in:
parent
645cfc65f4
commit
d18dd5b8fb
|
@ -163,13 +163,15 @@ export function OrderBookButton(props: {
|
||||||
const { limitBets, contract, className } = props
|
const { limitBets, contract, className } = props
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
|
|
||||||
const yesBets = sortBy(
|
const sortedBets = sortBy(
|
||||||
limitBets.filter((bet) => bet.outcome === 'YES'),
|
limitBets,
|
||||||
(bet) => -1 * bet.limitProb,
|
(bet) => -1 * bet.limitProb,
|
||||||
(bet) => bet.createdTime
|
(bet) => bet.createdTime
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const yesBets = sortedBets.filter((bet) => bet.outcome === 'YES')
|
||||||
const noBets = sortBy(
|
const noBets = sortBy(
|
||||||
limitBets.filter((bet) => bet.outcome === 'NO'),
|
sortedBets.filter((bet) => bet.outcome === 'NO'),
|
||||||
(bet) => bet.limitProb,
|
(bet) => bet.limitProb,
|
||||||
(bet) => bet.createdTime
|
(bet) => bet.createdTime
|
||||||
)
|
)
|
||||||
|
@ -202,7 +204,7 @@ export function OrderBookButton(props: {
|
||||||
</Row>
|
</Row>
|
||||||
<Col className="md:hidden">
|
<Col className="md:hidden">
|
||||||
<LimitOrderTable
|
<LimitOrderTable
|
||||||
limitBets={limitBets}
|
limitBets={sortedBets}
|
||||||
contract={contract}
|
contract={contract}
|
||||||
isYou={false}
|
isYou={false}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user