@@ -6,11 +6,9 @@ import { useNavigation } from '@react-navigation/native';
6
6
import { KeyringTypes } from '@metamask/keyring-controller' ;
7
7
8
8
// External dependencies.
9
- import { selectInternalAccounts } from '../../../selectors/accountsController' ;
10
9
import Cell , {
11
10
CellVariant ,
12
11
} from '../../../component-library/components/Cells/Cell' ;
13
- import { InternalAccount } from '@metamask/keyring-internal-api' ;
14
12
import { useStyles } from '../../../component-library/hooks' ;
15
13
import { TextColor } from '../../../component-library/components/Texts/Text' ;
16
14
import SensitiveText , {
@@ -68,8 +66,6 @@ const AccountSelectorList = ({
68
66
: AvatarAccountType . JazzIcon ,
69
67
shallowEqual ,
70
68
) ;
71
-
72
- const internalAccounts = useSelector ( selectInternalAccounts ) ;
73
69
const getKeyExtractor = ( { address } : Account ) => address ;
74
70
75
71
const renderAccountBalances = useCallback (
@@ -177,10 +173,8 @@ const AccountSelectorList = ({
177
173
178
174
const onNavigateToAccountActions = useCallback (
179
175
( selectedAccount : string ) => {
180
- const account = internalAccounts . find (
181
- ( accountData : InternalAccount ) =>
182
- accountData . address . toLowerCase ( ) === selectedAccount . toLowerCase ( ) ,
183
- ) ;
176
+ const account =
177
+ Engine . context . AccountsController . getAccountByAddress ( selectedAccount ) ;
184
178
185
179
if ( ! account ) return ;
186
180
@@ -189,7 +183,7 @@ const AccountSelectorList = ({
189
183
params : { selectedAccount : account } ,
190
184
} ) ;
191
185
} ,
192
- [ navigate , internalAccounts ] ,
186
+ [ navigate ] ,
193
187
) ;
194
188
195
189
const renderAccountItem : ListRenderItem < Account > = useCallback (
0 commit comments