From 570ab5c9c29e37f623874346d9c575499fee57c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Brzezin=CC=81ski?= Date: Mon, 29 May 2023 20:51:01 +0200 Subject: [PATCH] fix --- components/governance/ListMarket/ListMarket.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/governance/ListMarket/ListMarket.tsx b/components/governance/ListMarket/ListMarket.tsx index 2ac93121..2d4a34a9 100644 --- a/components/governance/ListMarket/ListMarket.tsx +++ b/components/governance/ListMarket/ListMarket.tsx @@ -81,10 +81,10 @@ const ListMarket = ({ goBack }: { goBack: () => void }) => { const [marketPk, setMarketPk] = useState('') const [currentView, setCurrentView] = useState(VIEWS.BASE_TOKEN) const [createOpenbookMarketModal, setCreateOpenbookMarket] = useState(false) - const baseBank = - group && baseToken ? group.banksMapByName.get(baseToken)![0] : null - const quoteBank = - group && quoteToken ? group.banksMapByName.get(quoteToken)![0] : null + const baseBanks = baseToken ? group?.banksMapByName.get(baseToken) : null + const quoteBanks = quoteToken ? group?.banksMapByName.get(quoteToken) : null + const baseBank = baseBanks?.length ? baseBanks[0] : null + const quoteBank = quoteBanks?.length ? quoteBanks[0] : null const marketName = `${baseToken?.toUpperCase()}/${quoteToken?.toUpperCase()}` const [baseTokens, quoteTokens] = useMemo(() => {