fix: improve large lists of assets [PERA-3885]#230
Merged
Conversation
fmsouza
commented
Mar 23, 2026
apps/mobile/src/components/PreferredCurrencyDisplay/usePreferredCurrencyDisplay.ts
Outdated
Show resolved
Hide resolved
apps/mobile/src/components/PreferredCurrencyDisplay/usePreferredCurrencyDisplay.ts
Outdated
Show resolved
Hide resolved
apps/mobile/src/components/PreferredCurrencyDisplay/usePreferredCurrencyDisplay.ts
Outdated
Show resolved
Hide resolved
…edCurrencyDisplay.ts
…edCurrencyDisplay.ts Co-authored-by: Yasin Çalışkan <yasincaliskandev@gmail.com>
yasincaliskan
approved these changes
Mar 23, 2026
| const priceIDs = useMemo(() => [sourceAssetId], [sourceAssetId]) | ||
| // Skip per-item price fetch when a pre-fetched price is provided (bulk query optimization) | ||
| const priceIDs = useMemo( | ||
| () => (preFetchedUsdPrice !== undefined ? [] : [sourceAssetId]), |
Collaborator
There was a problem hiding this comment.
We may consider adding no-negated-condition rule. What do you think?
Suggested change
| () => (preFetchedUsdPrice !== undefined ? [] : [sourceAssetId]), | |
| () => (!!preFetchedUsdPrice ? [] : [sourceAssetId]), |
Contributor
Author
There was a problem hiding this comment.
We can definitely discuss it, but I'm personally not a fan. There are some cases which are much easier to assess if we use negated conditions, so I don't see much benefit on not allowing that options to be used. But would be happy to do so in a follow up PR refactoring everywhere in case we agree on that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Description
Related Issues
Checklist
Additional Notes