1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

set providerFee amount only when avaialable

This commit is contained in:
Bogdan Fazakas 2022-06-16 07:12:56 +03:00
parent 9eb47f6602
commit 7a6df34be4

View File

@ -148,14 +148,16 @@ export default function Compute({
return return
} }
setInitializedProviderResponse(initializedProvider) setInitializedProviderResponse(initializedProvider)
setProviderFeeAmount( if (initializedProviderResponse?.datasets?.[0]?.providerFee) {
await unitsToAmount( setProviderFeeAmount(
web3, await unitsToAmount(
initializedProvider?.datasets?.[0]?.providerFee?.providerFeeToken, web3,
initializedProviderResponse?.datasets?.[0]?.providerFee initializedProvider?.datasets?.[0]?.providerFee?.providerFeeToken,
?.providerFeeAmount initializedProviderResponse?.datasets?.[0]?.providerFee
?.providerFeeAmount
)
) )
) }
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)