Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 407bd96

Browse files
kate/78896/ TrackJS: a.markets.forex is undefined (#7328)
* fix: add check for undefined values and add key for React Fragment after map method * refactor: change key for react fragment * refactor: add an empty commit --------- Co-authored-by: Matin shafiei <matin@deriv.com>
1 parent 5c208b9 commit 407bd96

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/javascript/app/pages/trade/markets.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ class Markets extends React.Component {
124124
let market_symbol = Defaults.get('market');
125125
const market_list = Symbols.markets();
126126
this.markets = getAvailableUnderlyings(market_list);
127-
delete this.markets.forex.submarkets.smart_fx;
127+
128+
if (this.markets.forex) {
129+
delete this.markets.forex.submarkets.smart_fx;
130+
}
131+
128132
this.underlyings = Symbols.getAllSymbols() || {};
129133
let underlying_symbol = Defaults.get('underlying');
130134

@@ -585,11 +589,11 @@ class Markets extends React.Component {
585589
<div className='mobile'>
586590
<React.Fragment>
587591
<ul>
588-
{Object.keys(group_markets).map((item) => {
592+
{Object.keys(group_markets).map((item, idx) => {
589593
const derived_category = group_markets[item].markets[0].key;
590594
return (
591595
item === 'none' ? (
592-
<React.Fragment>
596+
<React.Fragment key={`${item}_${idx}`}>
593597
{group_markets[item].markets.map((m) => (
594598
<li
595599
onClick = {scrollToMarket.bind(null, m.key)}

0 commit comments

Comments
 (0)