1
0
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:
EnzoVezzaro 2022-10-19 06:14:15 -04:00
parent 9ef93f5059
commit 7fef77afef

View File

@ -57,7 +57,7 @@ export default function Compute({
fileIsLoading?: boolean fileIsLoading?: boolean
consumableFeedback?: string consumableFeedback?: string
}): ReactElement { }): ReactElement {
const { accountId, web3 } = useWeb3() const { accountId, web3, isSupportedOceanNetwork } = useWeb3()
const newAbortController = useAbortController() const newAbortController = useAbortController()
const newCancelToken = useCancelToken() const newCancelToken = useCancelToken()
@ -140,14 +140,14 @@ export default function Compute({
setInitializedProviderResponse(initializedProvider) setInitializedProviderResponse(initializedProvider)
setProviderFeeAmount( const feeAmount = await unitsToAmount(
await unitsToAmount( !isSupportedOceanNetwork ? await getDummyWeb3(asset?.chainId) : web3,
web3 || (await getDummyWeb3(asset?.chainId)), initializedProvider?.datasets?.[0]?.providerFee?.providerFeeToken,
initializedProvider?.datasets?.[0]?.providerFee?.providerFeeToken, initializedProvider?.datasets?.[0]?.providerFee?.providerFeeAmount
initializedProvider?.datasets?.[0]?.providerFee?.providerFeeAmount
)
) )
setProviderFeeAmount(feeAmount)
const computeDuration = ( const computeDuration = (
parseInt(initializedProvider?.datasets?.[0]?.providerFee?.validUntil) - parseInt(initializedProvider?.datasets?.[0]?.providerFee?.validUntil) -
Math.floor(Date.now() / 1000) Math.floor(Date.now() / 1000)