From b265b2009ccde6453ab23d429c103bed14bfcc28 Mon Sep 17 00:00:00 2001 From: Kermit Finance <82954927+KermitSwap@users.noreply.github.com> Date: Sun, 30 May 2021 21:56:40 +0530 Subject: [PATCH] Fixed return bug Fixed the bug where SRM/USDC was being returned in all cases. This was because the first return only broke the .forEach loop and not the entire function. --- src/utils/tradingview.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/tradingview.tsx b/src/utils/tradingview.tsx index 5fa888ad7..1f620be62 100644 --- a/src/utils/tradingview.tsx +++ b/src/utils/tradingview.tsx @@ -1,10 +1,12 @@ import { USE_MARKETS } from './markets'; export const findTVMarketFromAddress = (marketAddressString: string) => { + let m_name = 'SRM/USDC'; USE_MARKETS.forEach((market) => { if (market.address.toBase58() === marketAddressString) { - return market.name; + m_name = market.name; } }); - return 'SRM/USDC'; + + return m_name; };