Skip to content

Commit

Permalink
fix null bytes in solana nfts being displayed (#3274)
Browse files Browse the repository at this point in the history
  • Loading branch information
callensm authored Mar 10, 2023
1 parent 0010955 commit e105fa4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/recoil/src/atoms/solana/nft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,18 @@ export const solanaNftById = equalSelectorFamily<
} else {
return uriData.metadata.data.name;
}
})();
})().replace(/\0/g, "");

const nft = {
id: nftTokenMetadata?.publicKey ?? "",
blockchain: Blockchain.SOLANA,
publicKey: nftToken.key,
mint: nftTokenMetadata?.account.mint,
metadataCollectionId: uriData?.metadata?.collection?.key.toString(),
name:
nftTokenMetadata?.account.data.name.replace(/\0/g, "") ??
(uriData ? uriData.tokenMetaUriData.name : "Unknown"),
name: (
nftTokenMetadata?.account.data.name ??
(uriData ? uriData.tokenMetaUriData.name : "Unknown")
).replace(/\0/g, ""),
description: uriData ? uriData.tokenMetaUriData.description : "",
externalUrl: uriData
? externalResourceUri(
Expand Down

1 comment on commit e105fa4

@vercel
Copy link

@vercel vercel bot commented on e105fa4 Mar 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.