Skip to content

Commit

Permalink
fix: check filtered tokens to prevent showing an empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-haynes committed Mar 4, 2022
1 parent e71a116 commit a5529b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/frontend/src/components/wallet/NFTs.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ const StyledContainer = styled.div`
`;

const NFTs = ({ tokens }) => {
if (tokens.length) {
const ownedTokens = tokens.filter(tokenDetails => tokenDetails.ownedTokensMetadata && tokenDetails.ownedTokensMetadata.length);
if (ownedTokens.length) {
return (
<StyledContainer>
{tokens.filter((tokenDetails) => tokenDetails.ownedTokensMetadata && tokenDetails.ownedTokensMetadata.length).map((tokenDetails) => (
{ownedTokens.map((tokenDetails) => (
<NFTBox
key={tokenDetails.contractName}
tokenDetails={tokenDetails}
Expand Down

0 comments on commit a5529b3

Please sign in to comment.