mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fix web3 connection for unsupported assets price
This commit is contained in:
parent
9ef93f5059
commit
7fef77afef
@ -57,7 +57,7 @@ export default function Compute({
|
||||
fileIsLoading?: boolean
|
||||
consumableFeedback?: string
|
||||
}): ReactElement {
|
||||
const { accountId, web3 } = useWeb3()
|
||||
const { accountId, web3, isSupportedOceanNetwork } = useWeb3()
|
||||
const newAbortController = useAbortController()
|
||||
const newCancelToken = useCancelToken()
|
||||
|
||||
@ -140,13 +140,13 @@ export default function Compute({
|
||||
|
||||
setInitializedProviderResponse(initializedProvider)
|
||||
|
||||
setProviderFeeAmount(
|
||||
await unitsToAmount(
|
||||
web3 || (await getDummyWeb3(asset?.chainId)),
|
||||
const feeAmount = await unitsToAmount(
|
||||
!isSupportedOceanNetwork ? await getDummyWeb3(asset?.chainId) : web3,
|
||||
initializedProvider?.datasets?.[0]?.providerFee?.providerFeeToken,
|
||||
initializedProvider?.datasets?.[0]?.providerFee?.providerFeeAmount
|
||||
)
|
||||
)
|
||||
|
||||
setProviderFeeAmount(feeAmount)
|
||||
|
||||
const computeDuration = (
|
||||
parseInt(initializedProvider?.datasets?.[0]?.providerFee?.validUntil) -
|
||||
|
Loading…
Reference in New Issue
Block a user