From 69c234be2a40e8d400da1675f844020f9b12b47d Mon Sep 17 00:00:00 2001
From: Martti Malmi
Date: Fri, 26 Aug 2022 14:43:36 +0300
Subject: [PATCH] display nft totalCount correctly
---
src/js/views/Profile.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/js/views/Profile.js b/src/js/views/Profile.js
index a17c1f53..13dfe183 100644
--- a/src/js/views/Profile.js
+++ b/src/js/views/Profile.js
@@ -166,8 +166,8 @@ class Profile extends View {
${this.isMyProfile ? html`(${t('disconnect')})` : ''}
- ${this.state.nfts.length ? html`
-
NFT (${this.state.nfts.length})
+ ${this.state.nfts.totalCount ? html`
+
NFT (${this.state.nfts.totalCount})
` : ''}
`;
@@ -302,7 +302,7 @@ class Profile extends View {
return html`
NFT
- ${this.state.nfts && this.state.nfts.map(nft => {
+ ${this.state.nfts && this.state.nfts.ownedNfts && this.state.nfts.ownedNfts.map(nft => {
let src = nft.media && nft.media[0] && nft.media[0].raw;
if (src && src.indexOf('ipfs://') === 0) {
src = `https://ipfs.io/ipfs/${src.substring(7)}`;
@@ -369,7 +369,7 @@ class Profile extends View {
// Get all NFTs
const nfts = await alchemy.nft.getNftsForOwner(address);
// Print NFTs
- this.setState({ nfts: nfts.ownedNfts });
+ this.setState({ nfts });
console.log(nfts);
};