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

disable whole effect

This commit is contained in:
Matthias Kretschmann 2020-10-27 17:34:22 +01:00
parent 960d20d1ea
commit a81d7b9d8b
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -10,8 +10,10 @@ import Pool from './Pool'
export default function AssetActions({ ddo }: { ddo: DDO }): ReactElement {
const { ocean, balance, accountId } = useOcean()
const { price } = useMetadata(ddo)
const [isBalanceSufficient, setIsBalanceSufficient] = useState<boolean>()
// const { price } = useMetadata(ddo)
// TODO: quick hack for
// https://github.com/oceanprotocol/market/issues/145
const [isBalanceSufficient, setIsBalanceSufficient] = useState<boolean>(true)
const [dtBalance, setDtBalance] = useState<string>()
const isCompute = Boolean(ddo.findServiceByType('compute'))
@ -35,14 +37,14 @@ export default function AssetActions({ ddo }: { ddo: DDO }): ReactElement {
init()
}, [ocean, accountId, ddo.dataToken])
// Check user balance against price
useEffect(() => {
if (!price || !price.value || !balance || !balance.ocean || !dtBalance)
return
// TODO: quick hack for
// https://github.com/oceanprotocol/market/issues/145
setIsBalanceSufficient(true)
// Check user balance against price
// useEffect(() => {
// if (!price || !price.value || !balance || !balance.ocean || !dtBalance)
// return
// setIsBalanceSufficient(
// compareAsBN(balance.ocean, `${price.value}`) || Number(dtBalance) >= 1
// )
@ -50,7 +52,7 @@ export default function AssetActions({ ddo }: { ddo: DDO }): ReactElement {
// return () => {
// setIsBalanceSufficient(false)
// }
}, [balance, price, dtBalance])
// }, [balance, price, dtBalance])
const UseContent = isCompute ? (
<Compute