Remove remaining ftbot.state references

This commit is contained in:
Matthias 2021-08-28 11:43:20 +02:00
parent 1168b996da
commit a58f678757
2 changed files with 28 additions and 5 deletions

View File

@ -28,6 +28,7 @@ import {
ProfitInterface,
PairHistory,
LogLine,
BacktestSteps,
} from '@/types';
import {
@ -76,6 +77,11 @@ export enum BotStoreGetters {
strategy = 'strategy',
strategyList = 'strategyList',
candleData = 'candleData',
backtestRunning = 'backtestRunning',
backtestStep = 'backtestStep',
backtestProgress = 'backtestProgress',
backtestHistory = 'backtestHistory',
selectedBacktestResultKey = 'selectedBacktestResultKey',
}
export default {
@ -210,6 +216,22 @@ export default {
[BotStoreGetters.history](state: FtbotStateType) {
return state.history;
},
[BotStoreGetters.backtestRunning](state: FtbotStateType): boolean {
return state.backtestRunning;
},
[BotStoreGetters.backtestStep](state: FtbotStateType): BacktestSteps {
return state.backtestStep;
},
[BotStoreGetters.backtestProgress](state: FtbotStateType): number {
return state.backtestProgress;
},
// TODO: type me
[BotStoreGetters.backtestHistory](state: FtbotStateType): {} {
return state.backtestHistory;
},
[BotStoreGetters.selectedBacktestResultKey](state: FtbotStateType): string {
return state.selectedBacktestResultKey;
},
},
mutations: {
updateRefreshRequired(state: FtbotStateType, refreshRequired: boolean) {

View File

@ -298,6 +298,7 @@ import TimeframeSelect from '@/components/ftbot/TimeframeSelect.vue';
import {
BacktestPayload,
BacktestSteps,
BotState,
PairHistory,
PairHistoryPayload,
@ -351,17 +352,17 @@ export default class Backtesting extends Vue {
selectedPlotConfig: PlotConfig = getCustomPlotConfig(getPlotConfigName());
@ftbot.State backtestRunning!: boolean;
@ftbot.Getter [BotStoreGetters.backtestRunning]!: boolean;
@ftbot.State backtestStep!: string;
@ftbot.Getter [BotStoreGetters.backtestStep]!: BacktestSteps;
@ftbot.Getter [BotStoreGetters.botState]?: BotState;
@ftbot.State backtestProgress!: number;
@ftbot.Getter [BotStoreGetters.backtestProgress]!: number;
@ftbot.State backtestHistory!: StrategyBacktestResult[];
@ftbot.Getter [BotStoreGetters.backtestHistory]!: StrategyBacktestResult[];
@ftbot.State selectedBacktestResultKey!: string;
@ftbot.Getter [BotStoreGetters.selectedBacktestResultKey]!: string;
@ftbot.Getter [BotStoreGetters.history]!: PairHistory;