From cf05b371efd3137c2fc614e3f6cbcf86103e9905 Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 25 Apr 2025 14:37:38 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../com/tangem/data/nft/DefaultNFTRepository.kt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/data/nft/src/main/kotlin/com/tangem/data/nft/DefaultNFTRepository.kt b/data/nft/src/main/kotlin/com/tangem/data/nft/DefaultNFTRepository.kt index fb01e242d4..28b4ba6492 100644 --- a/data/nft/src/main/kotlin/com/tangem/data/nft/DefaultNFTRepository.kt +++ b/data/nft/src/main/kotlin/com/tangem/data/nft/DefaultNFTRepository.kt @@ -30,6 +30,7 @@ import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.* import kotlinx.coroutines.joinAll import kotlinx.coroutines.launch +import java.lang.UnsupportedOperationException import java.util.concurrent.ConcurrentHashMap import javax.inject.Inject import com.tangem.blockchain.nft.models.NFTAsset as SdkNFTAsset @@ -85,8 +86,6 @@ internal class DefaultNFTRepository @Inject constructor( ) = coroutineScope { launch(dispatchers.io) { Either.catch { - expireAssets(userWalletId, network, collectionId) - val sdkCollectionId = NFTSdkCollectionIdentifierConverter.convertBack(collectionId) val assets = walletManagersFacade.getNFTAssets( @@ -95,6 +94,8 @@ internal class DefaultNFTRepository @Inject constructor( collectionIdentifier = sdkCollectionId, ) + expireAssets(userWalletId, network, collectionId) + assets.forEach { val assetId = NFTSdkAssetIdentifierConverter.convert(it.identifier) val price = getNFTRuntimeStore(userWalletId, network).getSalePriceSync(assetId) @@ -125,11 +126,13 @@ internal class DefaultNFTRepository @Inject constructor( ) } }.onLeft { - saveFailedStateInRuntime( - userWalletId = userWalletId, - network = network, - error = it, - ) + if (it !is UnsupportedOperationException) { + saveFailedStateInRuntime( + userWalletId = userWalletId, + network = network, + error = it, + ) + } } }.saveIn(getCollectionJobHolder(collectionId)).join() }