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:
parent
b38f30a67a
commit
c110f92cf6
@ -9,6 +9,7 @@ export interface AppConfig {
|
||||
metadataCacheUri: string
|
||||
infuraProjectId: string
|
||||
chainIds: number[]
|
||||
chainIdsSupported: number[]
|
||||
marketFeeAddress: string
|
||||
publisherMarketOrderFee: string
|
||||
publisherMarketFixedSwapFee: string
|
||||
|
@ -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
|
||||
|
@ -12,7 +12,7 @@ const DatasetSchema = (): object => {
|
||||
|
||||
const networksMain = filterNetworksByType(
|
||||
'mainnet',
|
||||
appConfig.chainIds,
|
||||
appConfig.chainIdsSupported,
|
||||
networksList
|
||||
)
|
||||
|
||||
|
@ -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
|
||||
)
|
||||
|
||||
|
@ -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}>
|
||||
|
Loading…
Reference in New Issue
Block a user