-
-
Notifications
You must be signed in to change notification settings - Fork 225
feat: Implement display nft media #1893
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
base: main
Are you sure you want to change the base?
Conversation
…e info on the issue connected to the PR
…nd handle it accordingly
Could you update the PR to describe the error scenarios meant to be covered here? It wasn't totally clear from the linked planning issue (which seemed to be about a larger feature, not focused on error handling) i.e. What is the "display NFT media" feature, and how does this PR relate to it? What problems are these changes meant to solve? |
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.
The updates look good! I can re-review once conflicts are resolved
Co-authored-by: Mark Stacey <[email protected]>
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.
LGTM!
const hasIpfsTokenURI = tokenURI.startsWith('ipfs://'); | ||
|
||
if (hasIpfsTokenURI && !isIpfsGatewayEnabled) { | ||
if (!displayNftMedia && !isIpfsGatewayEnabled) { |
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.
Nit: This can be removed as well, as it's covered by the next block
Ah, it looks like at least one test is still failing |
Co-authored-by: Mark Stacey <[email protected]>
Co-authored-by: Mark Stacey <[email protected]>
Co-authored-by: Mark Stacey <[email protected]>
…erage be reached by 0.12 percent
…erage be reached by 0.12 percent
Able to revert the commits that were wrong on this PR |
References
relates to: https://github.com/MetaMask/mobile-planning/issues/1166
This PR aims to solve the implementation of display nft media being a user preference.
It adds a handling error when the proxy or our third party fails, giving the possibility for the client to show a fallback image instead.
@metamask/preferences-controller
@metamask/assets-controller/NftController
This property was added in order to register if the fetch from third parties, open sea, the chain, or our proxy fails and we can avoid keep calling to update it, avoiding a loop that way,
This error can assume the value of 'Opensea import error', 'URI import error' and 'Both import failed'.
Checklist