Skip to content

Commit

Permalink
fix: imageUrl should fallback to media property
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmellis committed Jan 17, 2024
1 parent e395b4b commit 042a707
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@ const reservoirTokenToAsset = ({
};
vaultIds: string[];
}) => {
const imageUrl = token.image || token.imageSmall || token.media;
const animationUrl = token.media?.includes('.mp4') ? token.media : undefined;

const asset: Asset = {
assetAddress: token.contract,
tokenId: token.tokenId,
id: `${token.contract}/${token.tokenId}`,
imagePreviewUrl: token.imageSmall,
imageUrl: token.image,
imageUrl,
isFlagged: !!token.isFlagged,
name: token.name,
rarity: token.rarityScore,
rarityRank: token.rarityRank,
animationUrl: token.media?.includes('.mp4') ? token.media : undefined,
animationUrl,
quantity: token.supply ? BigInt(token.supply) : undefined,
traits: (token.attributes ?? []).reduce((acc, { key, value }) => {
return { ...acc, [key]: value };
Expand Down

0 comments on commit 042a707

Please sign in to comment.