diff --git a/patches/@metamask+assets-controllers+26.0.0.patch b/patches/@metamask+assets-controllers+26.0.0.patch index eac3cb9b749..c3a401b2e7e 100644 --- a/patches/@metamask+assets-controllers+26.0.0.patch +++ b/patches/@metamask+assets-controllers+26.0.0.patch @@ -19,24 +19,29 @@ index 0000000..b867ea9 +* Run "yarn patch:assets " in the mobile repo +* If you have changes also add them to the branch: patch/mobile-assets-controllers-26 diff --git a/node_modules/@metamask/assets-controllers/dist/AccountTrackerController.js b/node_modules/@metamask/assets-controllers/dist/AccountTrackerController.js -index ee99eb2..a447b70 100644 +index ee99eb2..c786b6c 100644 --- a/node_modules/@metamask/assets-controllers/dist/AccountTrackerController.js +++ b/node_modules/@metamask/assets-controllers/dist/AccountTrackerController.js -@@ -69,8 +69,12 @@ class AccountTrackerController extends polling_controller_1.StaticIntervalPollin +@@ -69,17 +69,28 @@ class AccountTrackerController extends polling_controller_1.StaticIntervalPollin : [this.getSelectedAddress()]; const accountsForChain = Object.assign({}, accountsByChainId[chainId]); for (const address of accountsToUpdate) { +- accountsForChain[address] = { +- balance: (0, controller_utils_1.BNToHex)(yield this.getBalanceFromChain(address, ethQuery)), +- }; + /** + * IMPORTANT NOTE ABOUT THIS PATCH + * This patch can be removed once Assets Controller is updated to v^27 + */ - accountsForChain[address] = { -- balance: (0, controller_utils_1.BNToHex)(yield this.getBalanceFromChain(address, ethQuery)), -+ balance: yield this.getBalanceFromChain(address, ethQuery), - }; ++ const balance = yield this.getBalanceFromChain(address, ethQuery); ++ if(balance){ ++ accountsForChain[address] = { ++ balance, ++ }; ++ } } this.update(Object.assign(Object.assign({}, (chainId === this.getCurrentChainId() && { -@@ -78,8 +82,12 @@ class AccountTrackerController extends polling_controller_1.StaticIntervalPollin + accounts: accountsForChain, })), { accountsByChainId: Object.assign(Object.assign({}, this.state.accountsByChainId), { [chainId]: accountsForChain }) })); } catch (err) {