Skip to content

Commit

Permalink
fix: change key for profit table and statment
Browse files Browse the repository at this point in the history
  • Loading branch information
kate-deriv committed Mar 29, 2023
1 parent 094c319 commit 7a42e7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/reports/src/Containers/profit-table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ReportsMeta } from '../Components/reports-meta.jsx';
import { getProfitTableColumnsTemplate } from 'Constants/data-table-constants';

const getRowAction = row_obj => {
const unsupported_contract_type = extractInfoFromShortcode(row_obj.shortcode).category.toUpperCase();
return getSupportedContracts()[extractInfoFromShortcode(row_obj.shortcode).category.toUpperCase()] &&
!isForwardStarting(row_obj.shortcode, row_obj.purchase_time_unix)
? getContractPath(row_obj.contract_id)
Expand All @@ -25,7 +26,7 @@ const getRowAction = row_obj => {
<Localize
i18n_default_text="The {{trade_type_name}} contract details aren't currently available. We're working on making them available soon."
values={{
trade_type_name: getUnsupportedContracts()[row_obj.type]?.name,
trade_type_name: getUnsupportedContracts()[unsupported_contract_type]?.name,
}}
/>
),
Expand Down
3 changes: 2 additions & 1 deletion packages/reports/src/Containers/statement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const DetailsComponent = ({ message = '', action_type = '' }) => {
const getRowAction = row_obj => {
let action;
if (row_obj.id && ['buy', 'sell'].includes(row_obj.action_type)) {
const unsupported_contract_type = extractInfoFromShortcode(row_obj.shortcode).category.toUpperCase();
action =
getSupportedContracts()[extractInfoFromShortcode(row_obj.shortcode).category.toUpperCase()] &&
!isForwardStarting(row_obj.shortcode, row_obj.purchase_time || row_obj.transaction_time)
Expand All @@ -64,7 +65,7 @@ const getRowAction = row_obj => {
<Localize
i18n_default_text="The {{trade_type_name}} contract details aren't currently available. We're working on making them available soon."
values={{
trade_type_name: getUnsupportedContracts()[row_obj.type]?.name,
trade_type_name: getUnsupportedContracts()[unsupported_contract_type]?.name,
}}
/>
),
Expand Down

0 comments on commit 7a42e7d

Please sign in to comment.