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() }