From 048da545d0a10a0a805fb9063ba15ac44d869b48 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 24 Jan 2023 07:03:01 +0100 Subject: [PATCH] Fix exception in detail_trade when selected trade closes --- src/stores/ftbot.ts | 4 ++-- src/views/TradesList.vue | 5 ++++- src/views/Trading.vue | 6 +++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/stores/ftbot.ts b/src/stores/ftbot.ts index f4ace09c..1c2d4c98 100644 --- a/src/stores/ftbot.ts +++ b/src/stores/ftbot.ts @@ -121,13 +121,13 @@ export function createBotSubStore(botId: string, botName: string) { : b.trade_id - a.trade_id, ); }, - tradeDetail: (state) => { + tradeDetail: (state): Trade | undefined => { // console.log('tradeDetail', state.openTrades.length, state.openTrades); let dTrade = state.openTrades.find((item) => item.trade_id === state.detailTradeId); if (!dTrade) { dTrade = state.trades.find((item) => item.trade_id === state.detailTradeId); } - return dTrade as Trade; + return dTrade; }, refreshNow: (state) => { if ( diff --git a/src/views/TradesList.vue b/src/views/TradesList.vue index c85ea908..d13a37fe 100644 --- a/src/views/TradesList.vue +++ b/src/views/TradesList.vue @@ -22,7 +22,10 @@ :stake-currency-decimals="botStore.activeBot.stakeCurrencyDecimals" empty-text="No closed trades so far." /> -
+