1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Use the networkController instead of preferencesController (#20127)

* listen for the networkController instead of preferencesController

* type of networkConfigurations is an object

* typo fix

* prettier
This commit is contained in:
António Regadas 2023-07-24 10:00:57 +01:00 committed by GitHub
parent 737173ed5a
commit 13faeeac2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -542,8 +542,13 @@ export default class MMIController extends EventEmitter {
const getAccountDetails = (address) =>
this.custodyController.getAccountDetails(address);
const extensionId = this.extension.runtime.id;
const { networkConfigurations: networkConfigurationsById } =
this.networkController.state;
const networkConfigurations = Object.values(networkConfigurationsById);
const networks = [
...this.preferencesController.getRpcMethodPreferences(),
...networkConfigurations,
{ chainId: CHAIN_IDS.MAINNET },
{ chainId: CHAIN_IDS.GOERLI },
];