Sort daily-chart correctly

closes #948
This commit is contained in:
Matthias 2022-09-27 18:11:58 +02:00
parent be563c62a8
commit 0160fbe61b
2 changed files with 7 additions and 1 deletions

View File

@ -9,7 +9,7 @@
<div>
<DailyChart
v-if="botStore.activeBot.dailyStats.data"
:daily-stats="botStore.activeBot.dailyStats"
:daily-stats="botStore.activeBot.dailyStatsSorted"
/>
</div>
<div>

View File

@ -161,6 +161,12 @@ export function createBotSubStore(botId: string, botName: string) {
botName: (state) => state.botState?.bot_name || 'freqtrade',
allTrades: (state) => [...state.openTrades, ...state.trades] as Trade[],
activeLocks: (state) => state.currentLocks?.locks || [],
dailyStatsSorted: (state): DailyReturnValue => {
return {
...state.dailyStats,
data: Object.values(state.dailyStats.data).sort((a, b) => (a.date > b.date ? 1 : -1)),
};
},
},
actions: {
botAdded() {