1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-14 09:14:52 +01:00

fix download button (#213)

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
This commit is contained in:
mihaisc 2020-11-05 13:56:41 +02:00 committed by GitHub
parent 300aedc856
commit 35fd83de73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,13 +35,20 @@ export default function Consume({
pricingIsLoading
} = usePricing(ddo)
const { consumeStepText, consume, consumeError } = useConsume()
const isDisabled =
!ocean ||
!isBalanceSufficient ||
typeof consumeStepText !== 'undefined' ||
pricingIsLoading
const [isDisabled, setIsDisabled] = useState(true)
const hasDatatoken = Number(dtBalance) >= 1
useEffect(() => {
setIsDisabled(
(!ocean ||
!isBalanceSufficient ||
typeof consumeStepText !== 'undefined' ||
pricingIsLoading) &&
!hasPreviousOrder
)
}, [hasPreviousOrder, isBalanceSufficient, consumeStepText, pricingIsLoading])
useEffect(() => {
if (!ocean || !accountId) return