From 0160fbe61b3303059b9a5843c7b020a55826643c Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 27 Sep 2022 18:11:58 +0200 Subject: [PATCH] Sort daily-chart correctly closes #948 --- src/components/ftbot/DailyStats.vue | 2 +- src/stores/ftbot.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/ftbot/DailyStats.vue b/src/components/ftbot/DailyStats.vue index 007c7faf..ef8c04ac 100644 --- a/src/components/ftbot/DailyStats.vue +++ b/src/components/ftbot/DailyStats.vue @@ -9,7 +9,7 @@
diff --git a/src/stores/ftbot.ts b/src/stores/ftbot.ts index dbfda20d..d4fc5459 100644 --- a/src/stores/ftbot.ts +++ b/src/stores/ftbot.ts @@ -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() {