Move PairSummary to props instead of using vuex

This commit is contained in:
Matthias 2020-12-05 17:06:26 +01:00
parent ffb55e0c1e
commit 082fd0c027
2 changed files with 13 additions and 8 deletions

View File

@ -27,9 +27,8 @@
<script lang="ts">
import { formatPercent, timestampms } from '@/shared/formatters';
import { BotStoreGetters } from '@/store/modules/ftbot';
import { Lock, Trade } from '@/types';
import { Component, Vue } from 'vue-property-decorator';
import { Component, Prop, Vue } from 'vue-property-decorator';
import { namespace } from 'vuex-class';
const ftbot = namespace('ftbot');
@ -44,11 +43,11 @@ interface CombinedPairList {
@Component({})
export default class PairSummary extends Vue {
@ftbot.Getter [BotStoreGetters.currentLocks]!: Lock[];
@Prop({ required: true }) pairlist!: string[];
@ftbot.Getter [BotStoreGetters.openTrades]!: Trade[];
@Prop({ required: true }) currentLocks!: Lock[];
@ftbot.State whitelist!: string[];
@Prop({ required: true }) openTrades!: Trade[];
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@ftbot.Action setSelectedPair!: (pair: string) => void;
@ -60,7 +59,7 @@ export default class PairSummary extends Vue {
get combinedPairList() {
const comb: CombinedPairList[] = [];
this.whitelist.forEach((pair) => {
this.pairlist.forEach((pair) => {
const trade = this.openTrades.find((el) => el.pair === pair);
const allLocks = this.currentLocks.filter((el) => el.pair === pair);
// Sort to have longer timeframe in front

View File

@ -30,7 +30,11 @@
<DraggableContainer header="Multi Pane">
<b-tabs content-class="mt-3" class="mt-3">
<b-tab title="Pairs combined" active>
<PairSummary />
<PairSummary
:pairlist="whitelist"
:current-locks="currentLocks"
:open-trades="openTrades"
/>
</b-tab>
<b-tab title="Status">
<BotStatus />
@ -157,7 +161,7 @@ import LogViewer from '@/components/ftbot/LogViewer.vue';
import DraggableContainer from '@/components/layout/DraggableContainer.vue';
import CandleChartContainer from '@/components/charts/CandleChartContainer.vue';
import { Trade } from '@/types';
import { Lock, Trade } from '@/types';
import { BotStoreGetters } from '@/store/modules/ftbot';
import { TradeLayout, findGridLayout, LayoutGetters, LayoutActions } from '@/store/modules/layout';
@ -197,6 +201,8 @@ export default class Trading extends Vue {
@ftbot.Getter [BotStoreGetters.timeframe]!: string;
@ftbot.Getter [BotStoreGetters.currentLocks]!: Lock[];
@ftbot.State whitelist!: string[];
@layoutNs.Getter [LayoutGetters.getTradingLayout]!: GridItemData[];