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 tokens = claims!
.filter(
(x) =>
x.mintProperties.type.toLowerCase() === 'token' &&
x.mintProperties.name.toLowerCase() !== 'gpu',
)
.filter((x) => x.mintProperties.type.toLowerCase() === 'token')
.map((t) => jupiterTokens.find((x) => x.address === t.mint.toBase58()))
.filter((x) => x)
.map((x) => x as Token)
const nfts = claims!.filter(
(x) =>
x.mintProperties.type.toLowerCase() === 'nft' ||
x.mintProperties.name.toLowerCase() === 'gpu',
(x) => x.mintProperties.type.toLowerCase() === 'nft',
)
const nftsInfos: (Sft | SftWithToken | Nft | NftWithToken)[] = []

View File

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