From e953919c9894c8efde372eccf314189be58b8640 Mon Sep 17 00:00:00 2001 From: prince-deriv Date: Wed, 3 Jul 2024 10:55:46 +0400 Subject: [PATCH] chore: clean and fix errors --- src/javascript/app/pages/trade/contract.js | 4 ++-- src/javascript/app/pages/trade/markets/market-selector.jsx | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/javascript/app/pages/trade/contract.js b/src/javascript/app/pages/trade/contract.js index 09f66cca820..008f380afc2 100644 --- a/src/javascript/app/pages/trade/contract.js +++ b/src/javascript/app/pages/trade/contract.js @@ -126,7 +126,7 @@ const Contract = (() => { } barrier = form_barrier.barrier_category; - contracts?.available.forEach((current_obj) => { + contracts.available.forEach((current_obj) => { const contract_category = current_obj.contract_category; // for callput and callputequals, populate duration for both if (form === contract_category || (/callput/.test(form) && /callput/.test(contract_category))) { @@ -202,7 +202,7 @@ const Contract = (() => { const getContractCategories = () => { const contracts = Contract.contracts().contracts_for; const contract_categories = {}; - contracts?.available?.forEach((current_obj) => { + contracts.available.forEach((current_obj) => { const contract_category = current_obj.contract_category; const contract_barrier = current_obj.barrier_category; const contract_display = current_obj.contract_category_display; diff --git a/src/javascript/app/pages/trade/markets/market-selector.jsx b/src/javascript/app/pages/trade/markets/market-selector.jsx index 73faa28d599..346c4bf8555 100644 --- a/src/javascript/app/pages/trade/markets/market-selector.jsx +++ b/src/javascript/app/pages/trade/markets/market-selector.jsx @@ -9,7 +9,6 @@ import Defaults, { PARAM_NAMES } from '../defaults.js'; const MarketSelector = () => { const [marketLabel, setMarketLabel] = useState(getMarketName()); - const [isMarketDropdownOpen, setMarketDropdownOpen] = useState(false); const [isContractDropdownOpen, setIsContractDropdownOpen] = useState(false); const [tradeTypeLabel, setTradeTypeLabel] = useState(''); const hasContractChange = useContractChange(); @@ -46,7 +45,6 @@ const MarketSelector = () => { useEffect(() => { setMarketLabel(getMarketName()); - setMarketDropdownOpen(false); }, [hasMarketChange]); return (