Skip to content

Commit

Permalink
Added NFT activity check
Browse files Browse the repository at this point in the history
  • Loading branch information
mpwanyi256 committed Nov 8, 2022
1 parent a289253 commit ad1bf6e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/WalletAccounts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
</ListItem>
<div class="account-assets" :class="{ active: shouldExpandAccount(account) }">
<ListItem
v-if="account.nfts && !isAssetList"
v-if="account.nfts && !isAssetList && hasNFTActivity(account)"
@item-selected="
$router.push({
path: `/wallet/nfts/activity/${account.id}`,
Expand Down Expand Up @@ -166,7 +166,7 @@ export default {
},
computed: {
...mapState(['activeWalletId', 'activeNetwork']),
...mapGetters(['accountsData']),
...mapGetters(['accountsData', 'activity']),
filteredItems() {
if (!this.search) return this.accounts
Expand Down Expand Up @@ -210,6 +210,12 @@ export default {
},
getDefaultTab(account) {
return account.nfts.length > 0 ? 'nfts' : 'activity'
},
hasNFTActivity(account) {
return (
this.activity.filter((item) => item.type === 'NFT' && item.accountId === account.id)
.length > 0
)
}
}
}
Expand Down

0 comments on commit ad1bf6e

Please sign in to comment.