fix nft show

This commit is contained in:
Adrian Brzeziński 2024-04-09 00:22:54 +02:00
parent 4c764395be
commit 9e58488569
2 changed files with 4 additions and 16 deletions

View File

@ -146,19 +146,13 @@ const ClaimPage = () => {
const metaplex = new Metaplex(connection) const metaplex = new Metaplex(connection)
const tokens = claims! const tokens = claims!
.filter( .filter((x) => x.mintProperties.type.toLowerCase() === 'token')
(x) =>
x.mintProperties.type.toLowerCase() === 'token' &&
x.mintProperties.name.toLowerCase() !== 'gpu',
)
.map((t) => jupiterTokens.find((x) => x.address === t.mint.toBase58())) .map((t) => jupiterTokens.find((x) => x.address === t.mint.toBase58()))
.filter((x) => x) .filter((x) => x)
.map((x) => x as Token) .map((x) => x as Token)
const nfts = claims!.filter( const nfts = claims!.filter(
(x) => (x) => x.mintProperties.type.toLowerCase() === 'nft',
x.mintProperties.type.toLowerCase() === 'nft' ||
x.mintProperties.name.toLowerCase() === 'gpu',
) )
const nftsInfos: (Sft | SftWithToken | Nft | NftWithToken)[] = [] const nftsInfos: (Sft | SftWithToken | Nft | NftWithToken)[] = []

View File

@ -63,14 +63,8 @@ export const getClaimsAsPrizes = (
nftsRewardsInfo: (Sft | SftWithToken | Nft | NftWithToken)[], nftsRewardsInfo: (Sft | SftWithToken | Nft | NftWithToken)[],
) => ) =>
claims.map((x) => { claims.map((x) => {
const rarity = const rarity = x.mintProperties.rarity.toLowerCase()
x.mintProperties.name.toLowerCase() === 'gpu' const type = x.mintProperties.type.toLowerCase()
? 'legendary'
: x.mintProperties.rarity.toLowerCase()
const type =
x.mintProperties.name.toLowerCase() === 'gpu'
? 'nft'
: x.mintProperties.type.toLowerCase()
const tokenInfo = const tokenInfo =
type === 'token' type === 'token'
? tokensInfo.find((t) => t.address === x.mint.toBase58()) ? tokensInfo.find((t) => t.address === x.mint.toBase58())