mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-23 11:35:14 +00:00
Convert ftbot getters to enum
This commit is contained in:
parent
dd6a03db66
commit
df54a797f5
|
@ -62,8 +62,6 @@ export default class TradeList extends Vue {
|
|||
|
||||
@ftbot.State detailTradeId?: string;
|
||||
|
||||
@ftbot.Getter openTradeDetail?: Trade;
|
||||
|
||||
@ftbot.Mutation setDetailTrade;
|
||||
|
||||
@ftbot.Action forcesell!: (tradeid: string) => Promise<string>;
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
import { api } from '@/shared/apiService';
|
||||
import { BotState, BlacklistPayload, ForcebuyPayload, Logs, DailyPayload } from '@/store/types';
|
||||
|
||||
export enum UserStoreGetters {
|
||||
openTrades = 'openTrades',
|
||||
openTradeDetail = 'openTradeDetail',
|
||||
closedTrades = 'closedTrades',
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
|
@ -20,14 +26,14 @@ export default {
|
|||
detailTradeId: null,
|
||||
},
|
||||
getters: {
|
||||
openTrades(state) {
|
||||
[UserStoreGetters.openTrades](state) {
|
||||
return state.openTrades;
|
||||
},
|
||||
openTradeDetail(state) {
|
||||
[UserStoreGetters.openTradeDetail](state) {
|
||||
const [dTrade] = state.openTrades.filter((item) => item.trade_id === state.detailTradeId);
|
||||
return dTrade;
|
||||
},
|
||||
closedTrades(state) {
|
||||
[UserStoreGetters.closedTrades](state) {
|
||||
return state.trades.filter((item) => !item.is_open);
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user