Updated on 2026-08-14
This commit is contained in:
parent
04ce95d61a
commit
1d374e5d07
3 changed files with 25 additions and 14 deletions
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue