prevent grouping from resetting to default on market refresh

This commit is contained in:
rjpeterson 2021-09-06 21:50:11 +08:00
parent cc517d1508
commit bb0a4594cc
1 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ export default function Orderbook({ depth = 8 }) {
const [grouping, setGrouping] = useState(.1)
useEffect(() => {
if(market) {
if(market && market.tickSize !== grouping) {
setGrouping(market.tickSize)
}
}, [market])
@ -184,7 +184,7 @@ export default function Orderbook({ depth = 8 }) {
return b[1]
})
)
const bidsToDisplay = defaultLayout
? getCumulativeOrderbookSide(bids, totalSize, maxSize, depth, false)
: getCumulativeOrderbookSide(bids, totalSize, maxSize, depth / 2, false)