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
|
metadataCacheUri: string
|
||||||
infuraProjectId: string
|
infuraProjectId: string
|
||||||
chainIds: number[]
|
chainIds: number[]
|
||||||
|
chainIdsSupported: number[]
|
||||||
marketFeeAddress: string
|
marketFeeAddress: string
|
||||||
publisherMarketOrderFee: string
|
publisherMarketOrderFee: string
|
||||||
publisherMarketFixedSwapFee: string
|
publisherMarketFixedSwapFee: string
|
||||||
|
@ -360,12 +360,12 @@ function Web3Provider({ children }: { children: ReactNode }): ReactElement {
|
|||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (appConfig.chainIds.includes(networkId)) {
|
if (appConfig.chainIdsSupported.includes(networkId)) {
|
||||||
setIsSupportedOceanNetwork(true)
|
setIsSupportedOceanNetwork(true)
|
||||||
} else {
|
} else {
|
||||||
setIsSupportedOceanNetwork(false)
|
setIsSupportedOceanNetwork(false)
|
||||||
}
|
}
|
||||||
}, [networkId, appConfig.chainIds])
|
}, [networkId, appConfig.chainIdsSupported])
|
||||||
|
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
// Handle change events
|
// Handle change events
|
||||||
|
@ -12,7 +12,7 @@ const DatasetSchema = (): object => {
|
|||||||
|
|
||||||
const networksMain = filterNetworksByType(
|
const networksMain = filterNetworksByType(
|
||||||
'mainnet',
|
'mainnet',
|
||||||
appConfig.chainIds,
|
appConfig.chainIdsSupported,
|
||||||
networksList
|
networksList
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,13 +20,13 @@ export default function Networks(): ReactElement {
|
|||||||
|
|
||||||
const networksMain = filterNetworksByType(
|
const networksMain = filterNetworksByType(
|
||||||
'mainnet',
|
'mainnet',
|
||||||
appConfig.chainIds,
|
appConfig.chainIdsSupported,
|
||||||
networksList
|
networksList
|
||||||
)
|
)
|
||||||
|
|
||||||
const networksTest = filterNetworksByType(
|
const networksTest = filterNetworksByType(
|
||||||
'testnet',
|
'testnet',
|
||||||
appConfig.chainIds,
|
appConfig.chainIdsSupported,
|
||||||
networksList
|
networksList
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -13,20 +13,19 @@ export default function AvailableNetworks(): ReactElement {
|
|||||||
|
|
||||||
const networksMain = filterNetworksByType(
|
const networksMain = filterNetworksByType(
|
||||||
'mainnet',
|
'mainnet',
|
||||||
appConfig.chainIds,
|
appConfig.chainIdsSupported,
|
||||||
networksList
|
networksList
|
||||||
)
|
)
|
||||||
|
|
||||||
const networksTest = filterNetworksByType(
|
const networksTest = filterNetworksByType(
|
||||||
'testnet',
|
'testnet',
|
||||||
appConfig.chainIds,
|
appConfig.chainIdsSupported,
|
||||||
networksList
|
networksList
|
||||||
)
|
)
|
||||||
const networkCategories = [
|
const networkCategories = [
|
||||||
{ title: 'Main', data: networksMain },
|
{ title: 'Main', data: networksMain },
|
||||||
{ title: 'Test', data: networksTest }
|
{ title: 'Test', data: networksTest }
|
||||||
]
|
]
|
||||||
|
|
||||||
const networkList = (networks: number[]) =>
|
const networkList = (networks: number[]) =>
|
||||||
networks.map((chainId) => (
|
networks.map((chainId) => (
|
||||||
<li key={chainId}>
|
<li key={chainId}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user