Skip to content

Commit

Permalink
Fix brave/brave-ios#8463: Only display NFTs after user updates any NF…
Browse files Browse the repository at this point in the history
…T's visibility status (brave/brave-ios#8470)

after NFT status chanegd, the re-computation needs to apply on only NFTs.
  • Loading branch information
nuo-xu authored Nov 23, 2023
1 parent 5b78e90 commit f6931cb
Showing 1 changed file with 14 additions and 0 deletions.
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

0 comments on commit f6931cb

Please sign in to comment.