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
|
||||
isLoading?: boolean
|
||||
}): ReactElement {
|
||||
if (!file) return null
|
||||
|
||||
const styleClasses = cx({
|
||||
file: true,
|
||||
small: small,
|
||||
@ -37,7 +35,7 @@ export default function FileIcon({
|
||||
|
||||
return (
|
||||
<ul className={styleClasses}>
|
||||
{isLoading === false || isLoading === undefined ? (
|
||||
{!isLoading && file ? (
|
||||
<>
|
||||
{file.contentType || file.contentLength ? (
|
||||
<>
|
||||
|
@ -73,7 +73,11 @@ export default function Download({
|
||||
setValidOrderTx(asset?.accessDetails?.validOrderTx)
|
||||
// get full price and fees
|
||||
async function init() {
|
||||
if (asset?.accessDetails?.addressOrId === ZERO_ADDRESS) return
|
||||
if (
|
||||
asset?.accessDetails?.addressOrId === ZERO_ADDRESS ||
|
||||
asset?.accessDetails?.type === 'free'
|
||||
)
|
||||
return
|
||||
setIsLoading(true)
|
||||
setStatusText('Calculating price including fees.')
|
||||
const orderPriceAndFees = await getOrderPriceAndFees(asset, ZERO_ADDRESS)
|
||||
|
Loading…
Reference in New Issue
Block a user