Fix the way we read the nft's metadata (#9707)

This commit is contained in:
Jegor Sidorenko 2023-08-06 12:56:53 +02:00 committed by GitHub
parent d78ae817b1
commit cdcbfda0e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -72,7 +72,7 @@ function useItemsInfosImpl (accountItems: AccountItem[]): ItemInfo[] | undefined
if (metadata && metadata[1].length) {
return metadata[1].map((o) =>
o.isSome
? o.unwrap().data.toString()
? o.unwrap().data.toPrimitive() as string
: ''
);
}

View File

@ -71,7 +71,7 @@ function extractInfo (allAccounts: string[], id: BN, optDetails: Option<PalletUn
}
const addIpfsData = (ipfsData: IpfsData) => (collectionInfo: CollectionInfo): CollectionInfo => {
const ipfsHash = collectionInfo.metadata && collectionInfo.metadata.data?.toString();
const ipfsHash = collectionInfo.metadata && collectionInfo.metadata.data?.toPrimitive() as string;
return {
...collectionInfo,
@ -90,7 +90,7 @@ function useCollectionInfosImpl (ids?: BN[]): CollectionInfo[] | undefined {
() => metadata && metadata[1].length
? metadata[1].map((o) =>
o.isSome
? o.unwrap().data.toString()
? o.unwrap().data.toPrimitive() as string
: ''
)
: [],