You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
I noticed that when the marketplace is configured to show only one collection and you open a wallet page (pages/address/[address].tsx) to see which NFTs the person owns, the UserTokensGrid.tsx component first shows all NFTs and then filters to show only the NFTs from the configured collection. This happens quickly but the first unfiltered result is visible for a split second which I think should be avoided.
Suggestion:
As far as I understand, the UseUserTokens hook from reservoir0x/reservoir-kit-ui returns an object that is saved as userTokens in UserTokensGrid.tsx with the method mutate(). Initially userTokens includes all tokens, and then in an useEffect hook mutate() is called to filter the results, which creates a new userTokens object that only includes NFTs from the configured collection.
I suggest to use a state to check whether the mutate function was already called and only show the results after that. Maybe there is a cleaner solution though. I will open a PR to address this issue.
For reference
screen-recording.mov
The text was updated successfully, but these errors were encountered:
Description:
I noticed that when the marketplace is configured to show only one collection and you open a wallet page (
pages/address/[address].tsx
) to see which NFTs the person owns, theUserTokensGrid.tsx
component first shows all NFTs and then filters to show only the NFTs from the configured collection. This happens quickly but the first unfiltered result is visible for a split second which I think should be avoided.Suggestion:
As far as I understand, the
UseUserTokens
hook fromreservoir0x/reservoir-kit-ui
returns an object that is saved asuserTokens
inUserTokensGrid.tsx
with the methodmutate()
. InitiallyuserTokens
includes all tokens, and then in an useEffect hookmutate()
is called to filter the results, which creates a newuserTokens
object that only includes NFTs from the configured collection.I suggest to use a state to check whether the mutate function was already called and only show the results after that. Maybe there is a cleaner solution though. I will open a PR to address this issue.
For reference
screen-recording.mov
The text was updated successfully, but these errors were encountered: