-
Notifications
You must be signed in to change notification settings - Fork 5.2k
fix: use same logic in details page to show IPFS images #30091
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
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
const ipfsGateway = useSelector(getIpfsGateway); | ||
const nftImageURL = useGetAssetImageUrl( | ||
imageOriginal ?? image ?? undefined, | ||
ipfsGateway, | ||
); | ||
|
||
const isImageHosted = | ||
image?.startsWith('https:') || image?.startsWith('http:'); | ||
const nftItemSrc = isImageHosted ? image : nftImageURL; | ||
|
||
const nftImageAlt = getNftImageAlt(nft); | ||
|
||
const nftSrcUrl = imageOriginal ?? image; | ||
const isIpfsURL = nftSrcUrl?.startsWith('ipfs:'); |
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.
This logic now matches the NFT Details page.
NOTE - we should probably refactor and reuse this logic. But for easier cherry-picks, we can keep it here.
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 main fix was this isIpfsURL
condition, as it seemed that the GridView before treated the IPFS url as a normal URL and attempted to fetch and display it.
Now the logic matches the details page, this has been resolved.
Builds ready [7b67c11]
Page Load Metrics (1625 ± 43 ms)
Bundle size diffs
|
Description
IPFS images in the grid view were not correctly identified and therefore were not fetched/displayed.
This copies the logic in the details page to ensure that we correctly show IPFS NFTs.
Related issues
Fixes: #30063
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist