Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
bergeron committed Apr 3, 2024
1 parent 8aef11f commit 2f5c68b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,36 +1,24 @@
diff --git a/dist/TokenDetectionController.js b/dist/TokenDetectionController.js
index 9aa09140d47424217eac118aebca9031e5d2a236..40eb28f29b4cd39422bd5d567cd3a8046a5402b9 100644
index 9aa09140d47424217eac118aebca9031e5d2a236..8100c432e7e01dbefcb5f53db3c58e51f120a51d 100644
--- a/dist/TokenDetectionController.js
+++ b/dist/TokenDetectionController.js
@@ -225,22 +225,18 @@ _TokenDetectionController_intervalId = new WeakMap(), _TokenDetectionController_
yield __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_restartTokenDetection).call(this);
}
}));
- this.messagingSystem.subscribe('PreferencesController:stateChange', ({ selectedAddress: newSelectedAddress, useTokenDetection }) => __awaiter(this, void 0, void 0, function* () {
- const isSelectedAddressChanged = __classPrivateFieldGet(this, _TokenDetectionController_selectedAddress, "f") !== newSelectedAddress;
- const isDetectionChangedFromPreferences = __classPrivateFieldGet(this, _TokenDetectionController_isDetectionEnabledFromPreferences, "f") !== useTokenDetection;
- __classPrivateFieldSet(this, _TokenDetectionController_selectedAddress, newSelectedAddress, "f");
- __classPrivateFieldSet(this, _TokenDetectionController_isDetectionEnabledFromPreferences, useTokenDetection, "f");
@@ -230,8 +230,7 @@ _TokenDetectionController_intervalId = new WeakMap(), _TokenDetectionController_
const isDetectionChangedFromPreferences = __classPrivateFieldGet(this, _TokenDetectionController_isDetectionEnabledFromPreferences, "f") !== useTokenDetection;
__classPrivateFieldSet(this, _TokenDetectionController_selectedAddress, newSelectedAddress, "f");
__classPrivateFieldSet(this, _TokenDetectionController_isDetectionEnabledFromPreferences, useTokenDetection, "f");
- if (useTokenDetection &&
- (isSelectedAddressChanged || isDetectionChangedFromPreferences)) {
- yield __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_restartTokenDetection).call(this, {
- selectedAddress: __classPrivateFieldGet(this, _TokenDetectionController_selectedAddress, "f"),
- });
+ this.messagingSystem.subscribe('PreferencesController:stateChange', ({ useTokenDetection }) => __awaiter(this, void 0, void 0, function* () {
+ if (__classPrivateFieldGet(this, _TokenDetectionController_isDetectionEnabledFromPreferences, "f") !== useTokenDetection) {
+ __classPrivateFieldSet(this, _TokenDetectionController_isDetectionEnabledFromPreferences, useTokenDetection, "f");
+ if (useTokenDetection) {
+ yield __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_restartTokenDetection).call(this, {
+ selectedAddress: __classPrivateFieldGet(this, _TokenDetectionController_selectedAddress, "f"),
+ });
+ }
}
+ if (isSelectedAddressChanged || isDetectionChangedFromPreferences) {
yield __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_restartTokenDetection).call(this, {
selectedAddress: __classPrivateFieldGet(this, _TokenDetectionController_selectedAddress, "f"),
});
@@ -239,8 +238,7 @@ _TokenDetectionController_intervalId = new WeakMap(), _TokenDetectionController_
}));
this.messagingSystem.subscribe('AccountsController:selectedAccountChange', ({ address: newSelectedAddress }) => __awaiter(this, void 0, void 0, function* () {
- const isSelectedAddressChanged = __classPrivateFieldGet(this, _TokenDetectionController_selectedAddress, "f") !== newSelectedAddress;
const isSelectedAddressChanged = __classPrivateFieldGet(this, _TokenDetectionController_selectedAddress, "f") !== newSelectedAddress;
- if (isSelectedAddressChanged &&
- __classPrivateFieldGet(this, _TokenDetectionController_isDetectionEnabledFromPreferences, "f")) {
+ if (__classPrivateFieldGet(this, _TokenDetectionController_selectedAddress, "f") !== newSelectedAddress) {
+ if (isSelectedAddressChanged) {
__classPrivateFieldSet(this, _TokenDetectionController_selectedAddress, newSelectedAddress, "f");
yield __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_restartTokenDetection).call(this, {
selectedAddress: __classPrivateFieldGet(this, _TokenDetectionController_selectedAddress, "f"),
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4042,7 +4042,7 @@ __metadata:

"@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A26.0.0#~/.yarn/patches/@metamask-assets-controllers-npm-26.0.0-17c0e9432c.patch":
version: 26.0.0
resolution: "@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A26.0.0#~/.yarn/patches/@metamask-assets-controllers-npm-26.0.0-17c0e9432c.patch::version=26.0.0&hash=5c15ac"
resolution: "@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A26.0.0#~/.yarn/patches/@metamask-assets-controllers-npm-26.0.0-17c0e9432c.patch::version=26.0.0&hash=cf1d54"
dependencies:
"@ethereumjs/util": "npm:^8.1.0"
"@ethersproject/address": "npm:^5.7.0"
Expand Down Expand Up @@ -4078,7 +4078,7 @@ __metadata:
"@metamask/keyring-controller": ^13.0.0
"@metamask/network-controller": ^17.2.0
"@metamask/preferences-controller": ^8.0.0
checksum: 9afa6240eb9ee892345795dd6188e9cb2f2dfb3734c7c111618690a074a87f48b7f36c1d4ba52f03db8161832cc3ca04dcc9a3e355ca395d25b4794878b4fb27
checksum: 44e0ce87c9a2e4e161771c212460947629502ad6e72542e87a29a3de6e9c6665190396a2ae7d8206e57ad091cb80ad6634dfbfd254632a5ee6833c496f1ad0ad
languageName: node
linkType: hard

Expand Down

0 comments on commit 2f5c68b

Please sign in to comment.