|
|
@@ -9,7 +9,15 @@ export const extractBidPrices = (data) => {
|
|
|
if (marketDepth) {
|
|
|
let buys = marketDepth.buys.map(b => +b.rate);
|
|
|
let sells = marketDepth.sells.map(b => +b.rate);
|
|
|
- return buys.concat(sells, [marketDepth.lastBuyQty !== 0 ? +marketDepth.lastBuyPrice : +marketDepth.lastSellPrice]);
|
|
|
+ let result = buys.concat(sells)
|
|
|
+ if (marketDepth.lastBuyQty > 0) {
|
|
|
+ result = result.concat([marketDepth.lastBuyPrice])
|
|
|
+ }
|
|
|
+ if (marketDepth.lastSellQty > 0) {
|
|
|
+ result = result.concat([marketDepth.lastSellPrice])
|
|
|
+ }
|
|
|
+
|
|
|
+ return result
|
|
|
}
|
|
|
return [];
|
|
|
}).reduce((acc, val) => acc.concat(val), []));
|