Sort closed trades by trade_id

This commit is contained in:
Matthias 2021-04-18 19:43:39 +02:00
parent 3bc285ec7b
commit 2fc8854060

View File

@ -81,7 +81,8 @@ export default {
return state.selectedPair;
},
[BotStoreGetters.closedTrades](state: FtbotStateType) {
return state.trades.filter((item) => !item.is_open);
// Sort by trade_id desc
return state.trades.filter((item) => !item.is_open).sort((a, b) => b.trade_id - a.trade_id);
},
[BotStoreGetters.timeframe](state: FtbotStateType): string {
return state.botState?.timeframe || '';