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

Use NETWORK_EVENTS.NETWORK_DID_CHANGE to trigger network change callback in assetsContractController (#16760)

This commit is contained in:
Dan J Miller 2022-12-01 11:03:38 -03:30 committed by GitHub
parent 025ee2cb48
commit 91e275e0d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -302,7 +302,8 @@ export default class MetamaskController extends EventEmitter {
onPreferencesStateChange: (listener) =>
this.preferencesController.store.subscribe(listener),
onNetworkStateChange: (cb) =>
this.networkController.store.subscribe((networkState) => {
this.networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, () => {
const networkState = this.networkController.store.getState();
const modifiedNetworkState = {
...networkState,
provider: {