chore(suite-native): slightly refactor native supported networks#16938
chore(suite-native): slightly refactor native supported networks#16938
Conversation
f42129c to
e41362c
Compare
|
🚀 Expo preview is ready!
|
|
/rebase |
|
Start rebasing: https://github.com/trezor/trezor-suite/actions/runs/13458094485 |
e41362c to
fce1aea
Compare
WalkthroughThis pull request refactors how network symbols are managed across the suite. In the configuration module, static constants used to hold collections of mainnet and testnet network symbols have been removed and replaced by two functions, ✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
suite-native/discovery/src/discoveryConfigSlice.ts (1)
145-148: Consider memoizing mainnet symbols.The
getNativeMainnetSymbols()is called on every selector execution. Consider adding it to the selector dependencies to leverage Redux's memoization:export const selectSupportedNetworkSymbols = createMemoizedSelector( - [selectSupportedTestnetNetworkSymbols], - testnets => returnStableArrayIfEmpty([...getNativeMainnetSymbols(), ...testnets]), + [selectSupportedTestnetNetworkSymbols, () => getNativeMainnetSymbols()], + (testnets, mainnets) => returnStableArrayIfEmpty([...mainnets, ...testnets]), );
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
suite-native/config/src/supportedNetworks.ts(1 hunks)suite-native/discovery/src/discoveryConfigSlice.ts(2 hunks)suite-native/module-accounts-import/src/components/SelectableNetworkList.tsx(2 hunks)suite-native/module-accounts-import/src/screens/AccountImportSummaryScreen.tsx(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: EAS Update
- GitHub Check: Setup and Cache Dependencies
- GitHub Check: prepare_android_test_app
- GitHub Check: Analyze with CodeQL (javascript)
🔇 Additional comments (4)
suite-native/module-accounts-import/src/components/SelectableNetworkList.tsx (1)
7-8: LGTM! Clean refactoring of network symbol management.The changes improve code clarity by:
- Using more descriptive function/selector names
- Replacing static constants with dynamic functions
- Using consistent naming across the codebase
Also applies to: 34-36, 42-42, 47-47
suite-native/config/src/supportedNetworks.ts (1)
63-71: Well-structured refactoring of network symbol management!The new functions improve maintainability by:
- Encapsulating filtering and sorting logic
- Using consistent patterns for both mainnet and testnet
- Leveraging existing whitelist configuration
suite-native/module-accounts-import/src/screens/AccountImportSummaryScreen.tsx (1)
9-9: LGTM! Clean variable renaming.The changes maintain functionality while improving naming consistency across the codebase.
Also applies to: 42-42, 45-45
suite-native/discovery/src/discoveryConfigSlice.ts (1)
14-15: LGTM! Clean selector renaming.The changes improve code clarity by using consistent naming across selectors.
Also applies to: 135-143
cleaning
Related Issue
Resolve #16683