-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version v11.15.0 remove unecessary pollings when mm closed (#24219)
Cherry picks #24162 [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24219?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
- Loading branch information
1 parent
297ecc8
commit 3d70b1f
Showing
6 changed files
with
127 additions
and
11 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
.yarn/patches/@metamask-assets-controllers-patch-0f46262fea.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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
diff --git a/dist/NftDetectionController.js b/dist/NftDetectionController.js | ||
index 24373e328d3600d1168914a3dc0bbbd905b19ebe..3877bebee24d1ad5cd2183b50547e8cef1846558 100644 | ||
--- a/dist/NftDetectionController.js | ||
+++ b/dist/NftDetectionController.js | ||
@@ -36,7 +36,7 @@ class NftDetectionController extends polling_controller_1.StaticIntervalPollingC | ||
* @param config - Initial options used to configure this controller. | ||
* @param state - Initial state to set on this controller. | ||
*/ | ||
- constructor({ chainId: initialChainId, getNetworkClientById, onPreferencesStateChange, onNetworkStateChange, getOpenSeaApiKey, addNft, getNftApi, getNftState, }, config, state) { | ||
+ constructor({ chainId: initialChainId, getNetworkClientById, onPreferencesStateChange, onNetworkStateChange, getOpenSeaApiKey, addNft, getNftApi, getNftState, disabled: initialDisabled, selectedAddress: initialSelectedAddress }, config, state) { | ||
super(config, state); | ||
/** | ||
* Name of this controller used during composition | ||
@@ -54,8 +54,8 @@ class NftDetectionController extends polling_controller_1.StaticIntervalPollingC | ||
this.defaultConfig = { | ||
interval: DEFAULT_INTERVAL, | ||
chainId: initialChainId, | ||
- selectedAddress: '', | ||
- disabled: true, | ||
+ selectedAddress: initialSelectedAddress, | ||
+ disabled: initialDisabled, | ||
}; | ||
this.initialize(); | ||
this.getNftState = getNftState; | ||
diff --git a/dist/Standards/NftStandards/ERC721/ERC721Standard.js b/dist/Standards/NftStandards/ERC721/ERC721Standard.js | ||
index d9286b0c0e607d2857f3ee7dad40d13a6c11d7d7..4e12e4b590b1f34a66602d63035f1905917f8c93 100644 | ||
--- a/dist/Standards/NftStandards/ERC721/ERC721Standard.js | ||
+++ b/dist/Standards/NftStandards/ERC721/ERC721Standard.js | ||
@@ -66,7 +66,10 @@ class ERC721Standard { | ||
const contract = new contracts_1.Contract(address, metamask_eth_abis_1.abiERC721, this.provider); | ||
const supportsMetadata = yield this.contractSupportsMetadataInterface(address); | ||
if (!supportsMetadata) { | ||
- throw new Error('Contract does not support ERC721 metadata interface.'); | ||
+ // Do not throw error here, supporting Metadata interface is optional even though majority of ERC721 nfts do support it. | ||
+ // This change is made because of instances of NFTs that are ERC404( mixed ERC20 / ERC721 implementation). | ||
+ // As of today, ERC404 is unofficial but some people use it, the contract does not support Metadata interface, but it has the tokenURI() fct. | ||
+ console.error('Contract does not support ERC721 metadata interface.'); | ||
} | ||
return contract.tokenURI(tokenId); | ||
}); |
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
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
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
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
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