@metamask-previews/network-controller 22.1.1-preview-ffa69e9 → 22.1.1-preview-2ebcbae7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -5
- package/dist/NetworkController.cjs +2 -30
- package/dist/NetworkController.cjs.map +1 -1
- package/dist/NetworkController.d.cts.map +1 -1
- package/dist/NetworkController.d.mts.map +1 -1
- package/dist/NetworkController.mjs +2 -30
- package/dist/NetworkController.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,11 +11,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
11
11
|
|
|
12
12
|
- Bump `@metamask/base-controller` from `^7.0.0` to `^7.1.0` ([#5079](https://github.com/MetaMask/core/pull/5079))
|
|
13
13
|
|
|
14
|
-
### Fixed
|
|
15
|
-
|
|
16
|
-
- Fix `lookupNetwork` so that it will no longer throw an error if `networkDidChange` subscriptions have been removed before it returns ([#5116](https://github.com/MetaMask/core/pull/5116))
|
|
17
|
-
- This error could occur if the NetworkController's messenger is cleared of subscriptions, as in a "destroy" step.
|
|
18
|
-
|
|
19
14
|
## [22.1.1]
|
|
20
15
|
|
|
21
16
|
### Changed
|
|
@@ -525,26 +525,7 @@ class NetworkController extends base_controller_1.BaseController {
|
|
|
525
525
|
let networkChanged = false;
|
|
526
526
|
const listener = () => {
|
|
527
527
|
networkChanged = true;
|
|
528
|
-
|
|
529
|
-
this.messagingSystem.unsubscribe('NetworkController:networkDidChange', listener);
|
|
530
|
-
}
|
|
531
|
-
catch (error) {
|
|
532
|
-
// In theory, this `catch` should not be necessary given that this error
|
|
533
|
-
// would occur "inside" of the call to `#determineEIP1559Compatibility`
|
|
534
|
-
// below and so it should be caught by the `try`/`catch` below (it is
|
|
535
|
-
// impossible to reproduce in tests for that reason). However, somehow
|
|
536
|
-
// it occurs within Mobile and so we have to add our own `try`/`catch`
|
|
537
|
-
// here.
|
|
538
|
-
/* istanbul ignore next */
|
|
539
|
-
if (!(error instanceof Error) ||
|
|
540
|
-
error.message !==
|
|
541
|
-
'Subscription not found for event: NetworkController:networkDidChange') {
|
|
542
|
-
// Again, this error should not happen and is impossible to reproduce
|
|
543
|
-
// in tests.
|
|
544
|
-
/* istanbul ignore next */
|
|
545
|
-
throw error;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
528
|
+
this.messagingSystem.unsubscribe('NetworkController:networkDidChange', listener);
|
|
548
529
|
};
|
|
549
530
|
this.messagingSystem.subscribe('NetworkController:networkDidChange', listener);
|
|
550
531
|
let updatedNetworkStatus;
|
|
@@ -594,16 +575,7 @@ class NetworkController extends base_controller_1.BaseController {
|
|
|
594
575
|
// in the process of being called, so we don't need to go further.
|
|
595
576
|
return;
|
|
596
577
|
}
|
|
597
|
-
|
|
598
|
-
this.messagingSystem.unsubscribe('NetworkController:networkDidChange', listener);
|
|
599
|
-
}
|
|
600
|
-
catch (error) {
|
|
601
|
-
if (!(error instanceof Error) ||
|
|
602
|
-
error.message !==
|
|
603
|
-
'Subscription not found for event: NetworkController:networkDidChange') {
|
|
604
|
-
throw error;
|
|
605
|
-
}
|
|
606
|
-
}
|
|
578
|
+
this.messagingSystem.unsubscribe('NetworkController:networkDidChange', listener);
|
|
607
579
|
this.update((state) => {
|
|
608
580
|
const meta = state.networksMetadata[state.selectedNetworkClientId];
|
|
609
581
|
meta.status = updatedNetworkStatus;
|