-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making asset unavailable for purchase if the size is zero #595
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/oceanprotocol/market/6iU2eN1MapMFARM7eq1tN8i9XJmD |
Code Climate has analyzed commit 35f3c46 and detected 0 issues on this pull request. View more on Code Climate. |
@@ -167,7 +167,11 @@ export default function Consume({ | |||
</div> | |||
<div className={styles.pricewrapper}> | |||
<Price price={price} conversion /> | |||
{!isInPurgatory && <PurchaseButton />} | |||
{parseInt(file?.contentLength) === 0 ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file
here refers to the file metadata object within the DDO, which is only set upon publish, retrieved when file is added in publish form. So this check here would only kick in if file has been published with contentLength: 0
which is very unlikely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use this provider POST method (https://docs.oceanprotocol.com/references/provider/#apiv1servicesfileinfo) to get the file Content-Type and Content-Length using the asset did
Feels like this is generally a better direction for solving #452, which could make #463 obsolete. If we can figure out file availability automatically by hitting the respective Likewise, this PR could be combined with #479 |
Closes:
Changes proposed in this PR: