-
Notifications
You must be signed in to change notification settings - Fork 187
feat(refactor): Remove OtherAccounts context, simplify account import logic
#3170
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
Conversation
OtherAccounts contextOtherAccounts context, simplify account import logic
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.
Pull request overview
This PR refactors the codebase by removing the OtherAccounts context, consolidating account management logic into existing contexts (ImportedAccounts and ExternalAccounts). The changes eliminate code duplication and simplify the account management architecture.
Key Changes:
- Removed the
OtherAccountscontext entirely (types and implementation) - Migrated account initialization logic to
ImportedAccountscontext - Enhanced
ExternalAccountscontext with getter method and state subscription - Updated all components to use
ImportedAccountsand direct hardware account hooks instead ofOtherAccounts
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/app/src/modals/ImportAccounts/WalletConnect.tsx | Replaced OtherAccounts usage with direct useHardwareAccounts hook calls |
| packages/app/src/modals/ImportAccounts/Vault.tsx | Removed OtherAccounts dependencies, simplified QR reader callback |
| packages/app/src/modals/ImportAccounts/Ledger.tsx | Eliminated OtherAccounts references, using only hardware account hooks |
| packages/app/src/modals/ExternalAccounts/ReadOnly/index.tsx | Removed duplicate forgetExternalAccounts call |
| packages/app/src/modals/ExternalAccounts/ReadOnly/Add.tsx | Removed redundant account management after external account addition |
| packages/app/src/hooks/useAccountFromUrl/index.tsx | Changed to use accountsInitialised from ImportedAccounts |
| packages/app/src/contexts/Proxies/index.tsx | Simplified proxy account addition by removing duplicate tracking |
| packages/app/src/contexts/Connect/OtherAccounts/types.ts | Deleted the entire types file for removed context |
| packages/app/src/contexts/Connect/OtherAccounts/index.tsx | Deleted the entire context implementation |
| packages/app/src/contexts/Connect/ImportedAccounts/types.ts | Added accountsInitialised to interface |
| packages/app/src/contexts/Connect/ImportedAccounts/index.tsx | Consolidated account aggregation and initialization logic from OtherAccounts |
| packages/app/src/contexts/Connect/ExternalAccounts/types.ts | Added getExternalAccounts method to interface |
| packages/app/src/contexts/Connect/ExternalAccounts/index.tsx | Added state management and subscription for external accounts |
| packages/app/src/Providers.tsx | Removed OtherAccountsProvider from provider chain |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
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.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
This PR refactors the codebase by removing the
OtherAccountscontext, consolidating account management logic into existing contexts (ImportedAccountsandExternalAccounts). The changes eliminate code duplication and simplify the account management architecture.Key Changes:
OtherAccountscontext entirely (types and implementation)ImportedAccountscontextExternalAccountscontext with getter method and state subscriptionImportedAccountsand direct hardware account hooks instead ofOtherAccounts