Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-19 13:46:47 +07:00
parent 04ce95d61a
commit 1d374e5d07
3 changed files with 25 additions and 14 deletions

View file

@ -84,7 +84,7 @@ internal class UpdateDataStateTransformer(
if (isAccountMode) {
val result = mutableListOf<NFTCollectionItem>()
walletNFTCollections.collections.forEach { (account, nfts) ->
if (nfts.isEmpty()) return@forEach
if (nfts.hasNoContentCollections()) return@forEach
result.add(account.toAccountPortfolioUM())
result.addAll(createNFTsUM(nfts))
}
@ -105,6 +105,12 @@ internal class UpdateDataStateTransformer(
),
)
private fun List<NFTCollections>.hasNoContentCollections() = this
.all { it.contentCollections().isEmpty() }
private fun NFTCollections.contentCollections() = (this.content as? NFTCollections.Content.Collections)
?.collections.orEmpty()
private fun NFTCollectionsStateUM.createNFTsUM(nftCollections: List<NFTCollections>): Sequence<NFTCollectionUM> =
nftCollections
.map { it.content }