-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
14 additions
and
26 deletions.
There are no files selected for viewing
36 changes: 12 additions & 24 deletions
36
.yarn/patches/@metamask-assets-controllers-npm-26.0.0-17c0e9432c.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters