diff --git a/spark-frontend/src/screens/TradeScreen/BottomTables/BottomTablesInterfaceSpot/BottomTablesInterfaceSpotImpl.tsx b/spark-frontend/src/screens/TradeScreen/BottomTables/BottomTablesInterfaceSpot/BottomTablesInterfaceSpotImpl.tsx index e6c70ad7..9c3a8b91 100644 --- a/spark-frontend/src/screens/TradeScreen/BottomTables/BottomTablesInterfaceSpot/BottomTablesInterfaceSpotImpl.tsx +++ b/spark-frontend/src/screens/TradeScreen/BottomTables/BottomTablesInterfaceSpot/BottomTablesInterfaceSpotImpl.tsx @@ -100,50 +100,54 @@ const BottomTablesInterfaceSpotImpl: React.FC = observer(() => { }; const getOrderData = () => - vm.myOrders.map((order) => ({ - date: order.timestamp.format("DD MMM YY, HH:mm"), - pair: order.marketSymbol, - type: ( - - {order.type} - - ), - amount: ( - - {order.baseSizeUnits.toSignificant(2)} - - {order.baseToken.symbol} - - - ), - price: toCurrency(order.priceUnits.toSignificant(2)), - action: ( - vm.cancelOrder(order.id)}> - {vm.isOrderCancelling ? "Loading..." : "Cancel"} - - ), - })); + vm.myOrders + .sort((a, b) => b.timestamp.valueOf() - a.timestamp.valueOf()) + .map((order) => ({ + date: order.timestamp.format("DD MMM YY, HH:mm"), + pair: order.marketSymbol, + type: ( + + {order.type} + + ), + amount: ( + + {order.baseSizeUnits.toSignificant(2)} + + {order.baseToken.symbol} + + + ), + price: toCurrency(order.priceUnits.toSignificant(2)), + action: ( + vm.cancelOrder(order.id)}> + {vm.isOrderCancelling ? "Loading..." : "Cancel"} + + ), + })); const getHistoryData = () => - vm.myOrdersHistory.map((order) => ({ - date: order.timestamp.format("DD MMM YY, HH:mm"), - pair: order.marketSymbol, - type: ( - - {order.type} - - ), - amount: ( - - {order.formatTradeAmount} - - {order.baseToken.symbol} - - - ), - price: toCurrency(order.formatPrice), - filled: order.formatTradeAmount, - })); + vm.myOrdersHistory + .sort((a, b) => b.timestamp.valueOf() - a.timestamp.valueOf()) + .map((order) => ({ + date: order.timestamp.format("DD MMM YY, HH:mm"), + pair: order.marketSymbol, + type: ( + + {order.type} + + ), + amount: ( + + {order.formatTradeAmount} + + {order.baseToken.symbol} + + + ), + price: toCurrency(order.formatPrice), + filled: order.formatTradeAmount, + })); const getBalanceData = () => Array.from(balanceStore.balances)