1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-14 17:24:51 +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,22 +37,22 @@ export default function AssetActions({ ddo }: { ddo: DDO }): ReactElement {
init()
}, [ocean, accountId, ddo.dataToken])
// TODO: quick hack for
// https://github.com/oceanprotocol/market/issues/145
// Check user balance against price
useEffect(() => {
if (!price || !price.value || !balance || !balance.ocean || !dtBalance)
return
// useEffect(() => {
// if (!price || !price.value || !balance || !balance.ocean || !dtBalance)
// return
// TODO: quick hack for
// https://github.com/oceanprotocol/market/issues/145
setIsBalanceSufficient(true)
// setIsBalanceSufficient(
// compareAsBN(balance.ocean, `${price.value}`) || Number(dtBalance) >= 1
// )
// setIsBalanceSufficient(
// compareAsBN(balance.ocean, `${price.value}`) || Number(dtBalance) >= 1
// )
// return () => {
// setIsBalanceSufficient(false)
// }
}, [balance, price, dtBalance])
// return () => {
// setIsBalanceSufficient(false)
// }
// }, [balance, price, dtBalance])
const UseContent = isCompute ? (
<Compute