Rename Getters enum to be correct

This commit is contained in:
Matthias 2020-09-14 20:26:25 +02:00
parent db99ab0879
commit 6ebdb33b72
2 changed files with 6 additions and 6 deletions

View File

@ -3,7 +3,7 @@ import { BotState, BlacklistPayload, ForcebuyPayload, Logs, DailyPayload, Trade
import { showAlert } from './alerts';
export enum UserStoreGetters {
export enum BotStoreGetters {
openTrades = 'openTrades',
tradeDetail = 'tradeDetail',
closedTrades = 'closedTrades',
@ -28,17 +28,17 @@ export default {
detailTradeId: null,
},
getters: {
[UserStoreGetters.openTrades](state) {
[BotStoreGetters.openTrades](state) {
return state.openTrades;
},
[UserStoreGetters.tradeDetail](state) {
[BotStoreGetters.tradeDetail](state) {
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;
},
[UserStoreGetters.closedTrades](state) {
[BotStoreGetters.closedTrades](state) {
return state.trades.filter((item) => !item.is_open);
},
},

View File

@ -129,7 +129,7 @@ import LogViewer from '@/components/ftbot/LogViewer.vue';
import DraggableContainer from '@/components/layout/DraggableContainer.vue';
import { Trade } from '@/types';
import { UserStoreGetters } from '@/store/modules/ftbot';
import { BotStoreGetters } from '@/store/modules/ftbot';
import { TradeLayout, findGridLayout } from '@/store/modules/layout';
const ftbot = namespace('ftbot');
@ -159,7 +159,7 @@ export default class Trading extends Vue {
@ftbot.Getter closedTrades!: Trade[];
@ftbot.Getter [UserStoreGetters.tradeDetail]!: Trade;
@ftbot.Getter [BotStoreGetters.tradeDetail]!: Trade;
@layoutNs.Getter getTradingLayout!: GridItemData[];