From 84dd0bf06bcb74df936bede0ec32eff0b5a99817 Mon Sep 17 00:00:00 2001 From: brave-builds <45370463+brave-builds@users.noreply.github.com> Date: Fri, 25 Oct 2024 08:16:39 +0200 Subject: [PATCH] fix(wallet): remove duplication nft_id when fetching nft metadata (uplift to 1.72.x) (#26185) Uplift of #26174 (squashed) to beta --- .../BraveWallet/Extensions/RpcServiceExtensions.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ios/brave-ios/Sources/BraveWallet/Extensions/RpcServiceExtensions.swift b/ios/brave-ios/Sources/BraveWallet/Extensions/RpcServiceExtensions.swift index 3fff3e48ffc0..ff63ce9f2682 100644 --- a/ios/brave-ios/Sources/BraveWallet/Extensions/RpcServiceExtensions.swift +++ b/ios/brave-ios/Sources/BraveWallet/Extensions/RpcServiceExtensions.swift @@ -440,7 +440,13 @@ extension BraveWalletJsonRpcService { guard let self = self else { return [:] } for (coin, tokensPerCoin) in tokenCoinMap { group.addTask { - let nftIdentifiers = tokensPerCoin.map { + var uniqueTokensPerCoin: [BraveWallet.BlockchainToken] = [] + for token in tokensPerCoin { + if !uniqueTokensPerCoin.contains(token) { + uniqueTokensPerCoin.append(token) + } + } + let nftIdentifiers = uniqueTokensPerCoin.map { BraveWallet.NftIdentifier( chainId: $0.chainId, contractAddress: $0.contractAddress,