diff --git a/src/components/ftbot/CustomTradeList.vue b/src/components/ftbot/CustomTradeList.vue index 83008578..203356f1 100644 --- a/src/components/ftbot/CustomTradeList.vue +++ b/src/components/ftbot/CustomTradeList.vue @@ -5,6 +5,7 @@ v-for="trade in filteredTrades" :key="trade.trade_id" class="border border-secondary rounded my-05 px-2" + @click="tradeClick(trade)" > @@ -43,7 +44,6 @@ import DeleteIcon from 'vue-material-design-icons/Delete.vue'; import ForceSellIcon from 'vue-material-design-icons/CloseBoxMultiple.vue'; import ActionIcon from 'vue-material-design-icons/GestureTap.vue'; import DateTimeTZ from '@/components/general/DateTimeTZ.vue'; -import { BotStoreGetters } from '@/store/modules/ftbot'; import StoreModules from '@/store/storeSubModules'; import CustomTradeListEntry from '@/components/ftbot/CustomTradeListEntry.vue'; import TradeProfit from './TradeProfit.vue'; @@ -85,8 +85,6 @@ export default class CustomTradeList extends Vue { @Prop({ default: 3, type: Number }) stakeCurrencyDecimals!: number; - @ftbot.Getter [BotStoreGetters.detailTradeId]?: number; - @ftbot.Action setDetailTrade; // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -162,30 +160,8 @@ export default class CustomTradeList extends Vue { }); } - onRowClicked(item, index) { - // Only allow single selection mode! - if ( - item && - item.trade_id !== this.detailTradeId && - !this.$refs.tradesTable.isRowSelected(index) - ) { - this.setDetailTrade(item); - } else { - console.log('unsetting item'); - this.setDetailTrade(null); - } - } - - onRowSelected() { - if (this.detailTradeId) { - const itemIndex = this.trades.findIndex((v) => v.trade_id === this.detailTradeId); - if (itemIndex >= 0) { - this.$refs.tradesTable.selectRow(itemIndex); - } else { - console.log(`Unsetting item for tradeid ${this.selectedItemIndex}`); - this.selectedItemIndex = undefined; - } - } + tradeClick(trade) { + this.setDetailTrade(trade); } } diff --git a/src/views/TradesList.vue b/src/views/TradesList.vue index f3e7b3cb..8699de51 100644 --- a/src/views/TradesList.vue +++ b/src/views/TradesList.vue @@ -8,7 +8,7 @@ empty-text="Currently no open trades." /> --> +
+ Back + +
@@ -29,6 +35,7 @@ import { Component, Prop, Vue } from 'vue-property-decorator'; import { namespace } from 'vuex-class'; import CustomTradeList from '@/components/ftbot/CustomTradeList.vue'; +import TradeDetail from '@/components/ftbot/TradeDetail.vue'; import { Trade } from '@/types'; import { BotStoreGetters } from '@/store/modules/ftbot'; @@ -39,6 +46,7 @@ const ftbot = namespace(StoreModules.ftbot); @Component({ components: { CustomTradeList, + TradeDetail, }, }) export default class Trading extends Vue { @@ -49,6 +57,14 @@ export default class Trading extends Vue { @ftbot.Getter [BotStoreGetters.closedTrades]!: Trade[]; @ftbot.Getter [BotStoreGetters.stakeCurrencyDecimals]!: number; + + @ftbot.Getter [BotStoreGetters.stakeCurrency]!: string; + + @ftbot.Getter [BotStoreGetters.detailTradeId]?: number; + + @ftbot.Getter [BotStoreGetters.tradeDetail]!: Trade; + + @ftbot.Action setDetailTrade; }