diff --git a/src/components/ftbot/TradeList.vue b/src/components/ftbot/TradeList.vue index 2ec76808..079a11d1 100644 --- a/src/components/ftbot/TradeList.vue +++ b/src/components/ftbot/TradeList.vue @@ -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; diff --git a/src/store/modules/ftbot.ts b/src/store/modules/ftbot.ts index 02e63924..31b6c6cd 100644 --- a/src/store/modules/ftbot.ts +++ b/src/store/modules/ftbot.ts @@ -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); }, },