Skip to content

Commit

Permalink
fix: remove unecessary calls to third party apis
Browse files Browse the repository at this point in the history
  • Loading branch information
sahar-fehri committed May 27, 2024
1 parent 8ee5376 commit 32e4d97
Show file tree
Hide file tree
Showing 2 changed files with 15,273 additions and 128 deletions.
31 changes: 3 additions & 28 deletions app/components/UI/CollectibleContracts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,43 +197,18 @@ const CollectibleContracts = ({
const updatableCollectibles = collectibles.filter((single) =>
shouldUpdateCollectibleMetadata(single),
);
if (updatableCollectibles.length !== 0) {

if (updatableCollectibles.length !== 0 && !useNftDetection) {
updateAllCollectibleMetadata(updatableCollectibles);
}
}, [
collectibles,
updateAllCollectibleMetadata,
isIpfsGatewayEnabled,
displayNftMedia,
useNftDetection,
]);

/* const updateCollectibleMetadata = useCallback(
async (collectible) => {
const { NftController } = Engine.context;
const { address, tokenId } = collectible;
const isIgnored = isCollectibleIgnored(collectible);
if (!isIgnored) {
if (String(tokenId).includes('e+')) {
removeFavoriteCollectible(selectedAddress, chainId, collectible);
} else {
await NftController.addNft(address, String(tokenId));
}
}
},
[chainId, removeFavoriteCollectible, selectedAddress, isCollectibleIgnored],
);
useEffect(() => {
// TO DO: Move this fix to the controllers layer
collectibles.forEach((collectible) => {
if (shouldUpdateCollectibleMetadata(collectible)) {
updateCollectibleMetadata(collectible);
}
});
}, [collectibles, updateCollectibleMetadata]); */

const goToAddCollectible = useCallback(() => {
setIsAddNFTEnabled(false);
navigation.push('AddAsset', { assetType: 'collectible' });
Expand Down
Loading

0 comments on commit 32e4d97

Please sign in to comment.