-
Notifications
You must be signed in to change notification settings - Fork 871
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(wallet): paginate portfolio NFTs page #23816
Conversation
c354693
to
ff57232
Compare
A Storybook has been deployed to preview UI for the latest push |
ff57232
to
604753c
Compare
A Storybook has been deployed to preview UI for the latest push |
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.
strings
++
604753c
to
69eeb0b
Compare
A Storybook has been deployed to preview UI for the latest push |
|
||
const chainIds = networksRegistry.ids.map( | ||
(network) => networksRegistry.entities[network]!.chainId | ||
) | ||
|
||
let currentCursor: string | null = null | ||
const accountSpamNfts = [] | ||
|
||
do { | ||
const { | ||
tokens, | ||
cursor | ||
}: { | ||
tokens: BraveWallet.BlockchainToken[] | ||
cursor: string | null | ||
} = await braveWalletService.getSimpleHashSpamNFTs( | ||
address, | ||
chainIds, | ||
coin, | ||
currentCursor | ||
) | ||
|
||
accountSpamNfts.push(...tokens) | ||
currentCursor = cursor | ||
} while (currentCursor) | ||
|
||
this.spamNftsForAccountRegistry[accountId.uniqueKey] = accountSpamNfts | ||
} |
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 just fetches everything with cursor. Should we do that in backend instead?
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.
We could if you would like to take a look are porting this to core
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.
@supermassive Do we want to handle this in this PR or in a follow-up?
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.
Some another PR would be ok
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.
Logged: brave/brave-browser#38823
/** if true, only spam NFT balances will be fetched, if falsey, only user | ||
* token balances will be fetched */ | ||
isSpamRegistry?: boolean |
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.
It makes sense to be consistent and comment with slashes //
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 was purposely commented using doc-comments to allow the comment to be visible when hovering over the variable within a code editor
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.
++
69eeb0b
to
e529466
Compare
[puLL-Merge] - brave/brave-core@23816 DescriptionThis PR adds several new features and improvements to the Brave Wallet UI:
The motivation for these changes is to improve the user experience and performance of the NFTs list view, especially for users with large collections of NFTs. ChangesChanges
Possible Issues
|
A Storybook has been deployed to preview UI for the latest push |
Resolves brave/brave-browser#38547
Resolves brave/brave-browser#26782
Resolves brave/brave-browser#38549
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Hide unowned NFTs
NFT list pagination