From b4e66f44b267a57cba098efbee295a75aba7d9ec Mon Sep 17 00:00:00 2001 From: msvstj Date: Wed, 16 Aug 2023 12:49:34 +0300 Subject: [PATCH] feat: in case of unsupported network - connect to Harmony Mainnet --- src/constants/chains.ts | 7 +++++-- src/pages/Swap/index.tsx | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/constants/chains.ts b/src/constants/chains.ts index 6ac91b57d0a..e89feb5ae99 100644 --- a/src/constants/chains.ts +++ b/src/constants/chains.ts @@ -1,4 +1,4 @@ -import { ChainId, SUPPORTED_CHAINS, SupportedChainsType } from '@uniswap/sdk-core' +import { ChainId, SupportedChainsType } from '@uniswap/sdk-core' export const UniWalletSupportedChains = [ChainId.MAINNET, ChainId.ARBITRUM_ONE, ChainId.OPTIMISM, ChainId.POLYGON] @@ -31,7 +31,10 @@ export function isSupportedChain( if (featureFlags && chainId && chainId in featureFlags) { return featureFlags[chainId] } - return !!chainId && SUPPORTED_CHAINS.indexOf(chainId) !== -1 && NOT_YET_UX_SUPPORTED_CHAIN_IDS.indexOf(chainId) === -1 + // return !!chainId && SUPPORTED_CHAINS.indexOf(chainId) !== -1 && NOT_YET_UX_SUPPORTED_CHAIN_IDS.indexOf(chainId) === -1 + // UPDATE: due to external fetch selecting currently supported network + // TODO: patch the supported netwok SDK library. + return chainId == ChainId.HARMONY } export function asSupportedChain( diff --git a/src/pages/Swap/index.tsx b/src/pages/Swap/index.tsx index 4bd46b4dbf3..00d776c71c4 100644 --- a/src/pages/Swap/index.tsx +++ b/src/pages/Swap/index.tsx @@ -147,7 +147,7 @@ export default function SwapPage({ className }: { className?: string }) {