Skip to content

Commit

Permalink
fix overriding token balance with canonical info
Browse files Browse the repository at this point in the history
  • Loading branch information
KorbinianK committed Nov 24, 2023
1 parent 89ede21 commit e148207
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/bridge-ui-v2/src/libs/token/fetchNFTImageUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ export const fetchNFTImageUrl = async (token: NFT, srcChainId: number, destChain
if (!url) throw new Error(`Invalid image URL: ${tokenWithMetadata.metadata.image}`);

const imageUrl = await fetchImageUrl(url, token.tokenId);
tokenWithMetadata.metadata = {

token.name = tokenWithMetadata.name; // TODO: discuss if we want to overwrite the name with the canonical one
token.metadata = {
...tokenWithMetadata.metadata,
image: imageUrl,
};

return tokenWithMetadata;
return token;
} catch (error) {
log(`Error fetching image for ${token.name} id: ${token.tokenId}`, error);
return token;
Expand Down

0 comments on commit e148207

Please sign in to comment.