mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-23 11:35:14 +00:00
Support trade-detail also on closed trades
This commit is contained in:
parent
843e54afec
commit
39c7a832ac
|
@ -3,7 +3,7 @@ import { BotState, BlacklistPayload, ForcebuyPayload, Logs, DailyPayload } from
|
||||||
|
|
||||||
export enum UserStoreGetters {
|
export enum UserStoreGetters {
|
||||||
openTrades = 'openTrades',
|
openTrades = 'openTrades',
|
||||||
openTradeDetail = 'openTradeDetail',
|
tradeDetail = 'tradeDetail',
|
||||||
closedTrades = 'closedTrades',
|
closedTrades = 'closedTrades',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,8 +29,11 @@ export default {
|
||||||
[UserStoreGetters.openTrades](state) {
|
[UserStoreGetters.openTrades](state) {
|
||||||
return state.openTrades;
|
return state.openTrades;
|
||||||
},
|
},
|
||||||
[UserStoreGetters.openTradeDetail](state) {
|
[UserStoreGetters.tradeDetail](state) {
|
||||||
const [dTrade] = state.openTrades.filter((item) => item.trade_id === state.detailTradeId);
|
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;
|
return dTrade;
|
||||||
},
|
},
|
||||||
[UserStoreGetters.closedTrades](state) {
|
[UserStoreGetters.closedTrades](state) {
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
emptyText="No closed trades so far."
|
emptyText="No closed trades so far."
|
||||||
v-if="!detailTradeId"
|
v-if="!detailTradeId"
|
||||||
/>
|
/>
|
||||||
<TradeDetail v-if="detailTradeId" :trade="openTradeDetail"></TradeDetail>
|
<TradeDetail v-if="detailTradeId" :trade="tradeDetail"></TradeDetail>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -104,7 +104,7 @@ export default class Trading extends Vue {
|
||||||
|
|
||||||
@ftbot.Getter closedTrades!: Array<Trade>;
|
@ftbot.Getter closedTrades!: Array<Trade>;
|
||||||
|
|
||||||
@ftbot.Getter [UserStoreGetters.openTradeDetail]!: Trade;
|
@ftbot.Getter [UserStoreGetters.tradeDetail]!: Trade;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user