Skip to content
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

Showcase mode does not behave correctly #7

Open
zaventh opened this issue Apr 11, 2022 · 2 comments
Open

Showcase mode does not behave correctly #7

zaventh opened this issue Apr 11, 2022 · 2 comments

Comments

@zaventh
Copy link

zaventh commented Apr 11, 2022

Version 0.7.0

Consider the following:

<NftGallery darkMode hasExternalLinks={false} showcaseMode
                                showcaseItemIds={[
                                    '0x148d1280a62ef720124537cdf53a084d499607e4/6',
                                    '0x148d1280a62ef720124537cdf53a084d499607e4/7',
                                ]}
                                ownerAddress="knitkins.eth"/>

What I expected to happen was for an XHR to OpenSea to gather the first 20 items from the ownerAddress and then filter those results for the defined showcaseItemIds and display two images.

What actually happens is the component makes 20 XHR requests to OpenSea and each time renders the two items twice. The result is a total of 40 images (20x2) displayed. If I add another showcaseItemIds to have say three total, then 40 requests to OpenSea are made and 90 images (30x3) are displayed.

Screenshot from 2022-04-11 14-38-00

Using the component in non-showcase mode behaves correctly and displays the most recent 20 results from OS (not using an API key currently).

I can provide additional details if necessary.

@zaventh
Copy link
Author

zaventh commented Apr 11, 2022

Two follow-up details

  1. Adding an openseaApiKey resolves this issue
  2. The contract address for showcaseItemIds appears to be case sensitive. That is not immediately intuitive and I think would be better made case insensitive.

@lesmo
Copy link

lesmo commented Jul 17, 2022

I see this behavior even in non-showcase mode, specifically when there are less than 20 NFTs to list. Haven't gone through the code, but I'm guessing the loop has a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants