Skip to content

Commit

Permalink
fix: tezos, elrond nft data issue not showing up on frontend.
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadusmanuet committed Aug 22, 2024
1 parent e5b7fd8 commit 0bc13c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/factory/elrond.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const tryBasic = async (
try {
let url = uri;
const format: string = uri
.match(/\.[0-9a-z]+$/i)[0]
.match(/\.[0-9a-z]+$/i)?.[0]
.replace(".", "")
.toUpperCase();

Expand All @@ -228,7 +228,7 @@ const tryBasic = async (
whitelisted,
image: setupURI(data.image),
imageFormat: data.image
.match(/\.[0-9a-z]+$/i)[0]
.match(/\.[0-9a-z]+$/i)?.[0]
.replace(".", ""),
name: data.name,
attributes: data.attributes,
Expand Down
8 changes: 5 additions & 3 deletions src/factory/tezos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ const getMetadata = async (nft: any, account = "", whitelisted = true) => {
collectionIdent: nft.collectionIdent,
metaData: {
whitelisted,
image: setupURI(data.displayUri),
imageFormat: await getAssetFormat(setupURI(data.displayUri)),
image: setupURI(data.displayUri || data.image),
imageFormat: await getAssetFormat(
setupURI(data.displayUri || data.image)
),
attributes: data?.attributes,
description: data?.description,
name: data?.name,
Expand Down Expand Up @@ -131,7 +133,7 @@ export const Default = async (
account: string,
whitelisted: boolean
): Promise<NFT> => {
if (!nft.native.meta) {
if (!nft.native.meta?.token) {
return await getMetadata(nft, account, whitelisted).catch(() => nft);
}

Expand Down

0 comments on commit 0bc13c3

Please sign in to comment.