diff --git a/src/components/organisms/AssetActions/Consume.tsx b/src/components/organisms/AssetActions/Consume.tsx index 599a9743f..cdfd07658 100644 --- a/src/components/organisms/AssetActions/Consume.tsx +++ b/src/components/organisms/AssetActions/Consume.tsx @@ -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