1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-16 02:04:54 +01:00

fix network name enforcement

This commit is contained in:
Matthias Kretschmann 2020-07-30 10:16:47 +02:00
parent c2dd8448cf
commit 7119014b08
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -2,7 +2,7 @@ import React, { ReactElement } from 'react'
import Status from '../../atoms/Status' import Status from '../../atoms/Status'
import styles from './Feedback.module.css' import styles from './Feedback.module.css'
import { useOcean } from '@oceanprotocol/react' import { useOcean } from '@oceanprotocol/react'
import { isCorrectNetwork, getNetworkName } from '../../../utils/wallet' import { isCorrectNetwork } from '../../../utils/wallet'
import { useSiteMetadata } from '../../../hooks/useSiteMetadata' import { useSiteMetadata } from '../../../hooks/useSiteMetadata'
export declare type Web3Error = { export declare type Web3Error = {
@ -21,7 +21,9 @@ export default function Web3Feedback({
const isOceanConnectionError = status === -1 const isOceanConnectionError = status === -1
const correctNetwork = isCorrectNetwork(chainId) const correctNetwork = isCorrectNetwork(chainId)
const showFeedback = !account || isOceanConnectionError || !correctNetwork const showFeedback = !account || isOceanConnectionError || !correctNetwork
const networkName = getNetworkName(appConfig.network) const networkName = appConfig.network.replace(/^\w/, (c: string) =>
c.toUpperCase()
)
const state = !account const state = !account
? 'error' ? 'error'