From c110f92cf6cc07f9bc21d177568085c0ed71b81c Mon Sep 17 00:00:00 2001 From: mihaisc Date: Fri, 7 Oct 2022 16:14:05 +0300 Subject: [PATCH] fix networks (#1731) --- src/@context/MarketMetadata/_types.ts | 1 + src/@context/Web3.tsx | 4 ++-- src/components/@shared/Page/Seo/DatasetSchema.tsx | 2 +- src/components/Header/UserPreferences/Networks/index.tsx | 4 ++-- src/components/Publish/AvailableNetworks/index.tsx | 5 ++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/@context/MarketMetadata/_types.ts b/src/@context/MarketMetadata/_types.ts index c941ec474..4d7ebe01c 100644 --- a/src/@context/MarketMetadata/_types.ts +++ b/src/@context/MarketMetadata/_types.ts @@ -9,6 +9,7 @@ export interface AppConfig { metadataCacheUri: string infuraProjectId: string chainIds: number[] + chainIdsSupported: number[] marketFeeAddress: string publisherMarketOrderFee: string publisherMarketFixedSwapFee: string diff --git a/src/@context/Web3.tsx b/src/@context/Web3.tsx index f760bd887..71e48f19a 100644 --- a/src/@context/Web3.tsx +++ b/src/@context/Web3.tsx @@ -360,12 +360,12 @@ function Web3Provider({ children }: { children: ReactNode }): ReactElement { // ----------------------------------- useEffect(() => { - if (appConfig.chainIds.includes(networkId)) { + if (appConfig.chainIdsSupported.includes(networkId)) { setIsSupportedOceanNetwork(true) } else { setIsSupportedOceanNetwork(false) } - }, [networkId, appConfig.chainIds]) + }, [networkId, appConfig.chainIdsSupported]) // ----------------------------------- // Handle change events diff --git a/src/components/@shared/Page/Seo/DatasetSchema.tsx b/src/components/@shared/Page/Seo/DatasetSchema.tsx index 0e2aa2184..d5716065f 100644 --- a/src/components/@shared/Page/Seo/DatasetSchema.tsx +++ b/src/components/@shared/Page/Seo/DatasetSchema.tsx @@ -12,7 +12,7 @@ const DatasetSchema = (): object => { const networksMain = filterNetworksByType( 'mainnet', - appConfig.chainIds, + appConfig.chainIdsSupported, networksList ) diff --git a/src/components/Header/UserPreferences/Networks/index.tsx b/src/components/Header/UserPreferences/Networks/index.tsx index 800b9944b..d3bbadefb 100644 --- a/src/components/Header/UserPreferences/Networks/index.tsx +++ b/src/components/Header/UserPreferences/Networks/index.tsx @@ -20,13 +20,13 @@ export default function Networks(): ReactElement { const networksMain = filterNetworksByType( 'mainnet', - appConfig.chainIds, + appConfig.chainIdsSupported, networksList ) const networksTest = filterNetworksByType( 'testnet', - appConfig.chainIds, + appConfig.chainIdsSupported, networksList ) diff --git a/src/components/Publish/AvailableNetworks/index.tsx b/src/components/Publish/AvailableNetworks/index.tsx index 98912b4a0..8e74dad5d 100644 --- a/src/components/Publish/AvailableNetworks/index.tsx +++ b/src/components/Publish/AvailableNetworks/index.tsx @@ -13,20 +13,19 @@ export default function AvailableNetworks(): ReactElement { const networksMain = filterNetworksByType( 'mainnet', - appConfig.chainIds, + appConfig.chainIdsSupported, networksList ) const networksTest = filterNetworksByType( 'testnet', - appConfig.chainIds, + appConfig.chainIdsSupported, networksList ) const networkCategories = [ { title: 'Main', data: networksMain }, { title: 'Test', data: networksTest } ] - const networkList = (networks: number[]) => networks.map((chainId) => (