1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

fix networks (#1731)

This commit is contained in:
mihaisc 2022-10-07 16:14:05 +03:00 committed by GitHub
parent b38f30a67a
commit c110f92cf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View File

@ -9,6 +9,7 @@ export interface AppConfig {
metadataCacheUri: string
infuraProjectId: string
chainIds: number[]
chainIdsSupported: number[]
marketFeeAddress: string
publisherMarketOrderFee: string
publisherMarketFixedSwapFee: string

View File

@ -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

View File

@ -12,7 +12,7 @@ const DatasetSchema = (): object => {
const networksMain = filterNetworksByType(
'mainnet',
appConfig.chainIds,
appConfig.chainIdsSupported,
networksList
)

View File

@ -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
)

View File

@ -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) => (
<li key={chainId}>