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

fix provider fee load at first algo selection

This commit is contained in:
Bogdan Fazakas 2022-06-17 12:14:25 +03:00
parent a54a5dc0c6
commit e222b730af

View File

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