Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #8463: Only display NFTs after user updates any NFT's visibility status #8470

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Sources/BraveWallet/Crypto/Stores/NFTStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,21 @@ public class NFTStore: ObservableObject, WalletObserverStore {
let selectedAccounts = self.filters.accounts.filter(\.isSelected).map(\.model)
let selectedNetworks = self.filters.networks.filter(\.isSelected).map(\.model)
let userVisibleAssets = self.assetManager.getAllUserAssetsInNetworkAssetsByVisibility(networks: selectedNetworks, visible: true)
.map { networkAssets in
NetworkAssets(
network: networkAssets.network,
tokens: networkAssets.tokens.filter { $0.isNft || $0.isErc721 },
sortOrder: networkAssets.sortOrder
)
}
let userHiddenAssets = self.assetManager.getAllUserAssetsInNetworkAssetsByVisibility(networks: selectedNetworks, visible: false)
.map { networkAssets in
NetworkAssets(
network: networkAssets.network,
tokens: networkAssets.tokens.filter { $0.isNft || $0.isErc721 },
sortOrder: networkAssets.sortOrder
)
}
let unionedSpamNFTs = computeSpamNFTs(
selectedNetworks: selectedNetworks,
selectedAccounts: selectedAccounts,
Expand Down