mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-25 04:25:15 +00:00
Update src/components/ftbot/TradeListNav.vue
Co-authored-by: Matthias <xmatthias@outlook.com>
This commit is contained in:
parent
b781a45bee
commit
e3f86c8d78
|
@ -24,23 +24,10 @@ const onTradeSelect = (trade: Trade) => {
|
|||
};
|
||||
|
||||
const sortedTrades = computed(() => {
|
||||
if (sortMethod.value === 'profit') {
|
||||
return props.trades
|
||||
.slice()
|
||||
.sort((a, b) =>
|
||||
sortDescendingOrder.value
|
||||
? b.profit_ratio - a.profit_ratio
|
||||
: a.profit_ratio - b.profit_ratio,
|
||||
);
|
||||
} else {
|
||||
return props.trades
|
||||
.slice()
|
||||
.sort((a, b) =>
|
||||
sortDescendingOrder.value
|
||||
? b.open_timestamp - a.open_timestamp
|
||||
: a.open_timestamp - b.open_timestamp,
|
||||
);
|
||||
}
|
||||
const field: keyof Trade = sortMethod.value === 'profit' ? 'profit_ratio' : 'open_timestamp';
|
||||
return sortDescendingOrder.value
|
||||
? props.trades.slice().sort((a, b) => b[field] - a[field])
|
||||
: props.trades.slice().sort((a, b) => a[field] - b[field]);
|
||||
});
|
||||
|
||||
const ordersVisible = ref(sortedTrades.value.map(() => false));
|
||||
|
|
Loading…
Reference in New Issue
Block a user