mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
disable price calculation for free price (#1198)
* disable price calculation for free price * make file icon visible on component mount * check if accessDetails are present
This commit is contained in:
parent
9d1b7794a3
commit
d1d24ef4d5
@ -27,8 +27,6 @@ export default function FileIcon({
|
|||||||
small?: boolean
|
small?: boolean
|
||||||
isLoading?: boolean
|
isLoading?: boolean
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
if (!file) return null
|
|
||||||
|
|
||||||
const styleClasses = cx({
|
const styleClasses = cx({
|
||||||
file: true,
|
file: true,
|
||||||
small: small,
|
small: small,
|
||||||
@ -37,7 +35,7 @@ export default function FileIcon({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ul className={styleClasses}>
|
<ul className={styleClasses}>
|
||||||
{isLoading === false || isLoading === undefined ? (
|
{!isLoading && file ? (
|
||||||
<>
|
<>
|
||||||
{file.contentType || file.contentLength ? (
|
{file.contentType || file.contentLength ? (
|
||||||
<>
|
<>
|
||||||
|
@ -73,7 +73,11 @@ export default function Download({
|
|||||||
setValidOrderTx(asset?.accessDetails?.validOrderTx)
|
setValidOrderTx(asset?.accessDetails?.validOrderTx)
|
||||||
// get full price and fees
|
// get full price and fees
|
||||||
async function init() {
|
async function init() {
|
||||||
if (asset?.accessDetails?.addressOrId === ZERO_ADDRESS) return
|
if (
|
||||||
|
asset?.accessDetails?.addressOrId === ZERO_ADDRESS ||
|
||||||
|
asset?.accessDetails?.type === 'free'
|
||||||
|
)
|
||||||
|
return
|
||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
setStatusText('Calculating price including fees.')
|
setStatusText('Calculating price including fees.')
|
||||||
const orderPriceAndFees = await getOrderPriceAndFees(asset, ZERO_ADDRESS)
|
const orderPriceAndFees = await getOrderPriceAndFees(asset, ZERO_ADDRESS)
|
||||||
|
Loading…
Reference in New Issue
Block a user