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

Fix all user NFTs showing before mutate method is called #574

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andriy1221
Copy link

Suggested fix for the following issue: #573
Close: #573

@vercel
Copy link

vercel bot commented Nov 2, 2022

Someone is attempting to deploy a commit to the Uneven Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@pandurand pandurand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new mutated state variable seems to fix the issue, but at the expense of making the business logic of this page more complex.

It seems like fallback is the source of the problem. It contains all the tokens that owner has by default, and as a result, the page initially displays the fallback tokens until the actual result is fetched. When forcing the fallback to be { tokens: [] }, we don't have the problem depicted in #573.

To me it seems like using a fallback in the first place is conflicting with the idea of displaying placeholders while the data is being loaded. What do you think @pedromcunha ?

@pedromcunha
Copy link
Member

Yeah this seems to be happening because of the prerendering. I'll add this to our list to fix. I would prefer to maintain the prerendering, this PR actually ignores the prerendered page. I'll add this to our list to investigate and fix. You can have a crack at fixing this yourselves. I would start by looking at where the prerendering logic is happening: https://github.com/reservoirprotocol/marketplace/blob/main/pages/address/%5Baddress%5D.tsx#L219
It could be that the filtering there is just not applying the right filters for that specific environment variable configuration.

@jakeywan
Copy link

jakeywan commented Dec 2, 2022

Just fixed this one for my marketplace, there's just a missing check for COLLECTION in the logic in the file referenced above: https://github.com/reservoirprotocol/marketplace/blob/main/pages/address/%5Baddress%5D.tsx#L219. I'll submit a PR.
Screen Shot 2022-12-02 at 1 48 14 PM

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

Successfully merging this pull request may close these issues.

When configured for a single collection, UserTokensGrid.tsx shows all NFTs for a split second
4 participants