Commit 0f8d3fa5 authored by Charles Bachmeier's avatar Charles Bachmeier Committed by GitHub

fix: add more null checks for trending collections gql query (#6164)

add more null checks for trending collections gql query
Co-authored-by: default avatarCharles Bachmeier <charlie@genie.xyz>
parent 5f64149f
......@@ -68,20 +68,20 @@ export function useTrendingCollections(size: number, timePeriod: HistoryDuration
const collection = edge?.node
return {
name: collection.name,
address: collection.nftContracts?.[0].address,
address: collection.nftContracts?.[0]?.address,
imageUrl: collection.image?.url,
bannerImageUrl: collection.bannerImage?.url,
isVerified: collection.isVerified,
volume: collection.markets?.[0].volume?.value,
volumeChange: collection.markets?.[0].volumePercentChange?.value,
floor: collection.markets?.[0].floorPrice?.value,
floorChange: collection.markets?.[0].floorPricePercentChange?.value,
marketCap: collection.markets?.[0].totalVolume?.value,
volume: collection.markets?.[0]?.volume?.value,
volumeChange: collection.markets?.[0]?.volumePercentChange?.value,
floor: collection.markets?.[0]?.floorPrice?.value,
floorChange: collection.markets?.[0]?.floorPricePercentChange?.value,
marketCap: collection.markets?.[0]?.totalVolume?.value,
percentListed:
(collection.markets?.[0].listings?.value ?? 0) / (collection.nftContracts?.[0].totalSupply ?? 1),
owners: collection.markets?.[0].owners,
sales: collection.markets?.[0].sales?.value,
totalSupply: collection.nftContracts?.[0].totalSupply,
(collection.markets?.[0]?.listings?.value ?? 0) / (collection.nftContracts?.[0]?.totalSupply ?? 1),
owners: collection.markets?.[0]?.owners,
sales: collection.markets?.[0]?.sales?.value,
totalSupply: collection.nftContracts?.[0]?.totalSupply,
}
}),
[data?.topCollections?.edges]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment