diff --git a/features/nft/impl/build.gradle.kts b/features/nft/impl/build.gradle.kts index a33b3e1ad5..7aba5590b7 100644 --- a/features/nft/impl/build.gradle.kts +++ b/features/nft/impl/build.gradle.kts @@ -27,6 +27,7 @@ dependencies { implementation(projects.core.datasource) /** Domain modules */ + implementation(projects.domain.models) implementation(projects.domain.nft) implementation(projects.domain.nft.models) implementation(projects.domain.tokens.models) diff --git a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/collections/entity/transformer/UpdateDataStateTransformer.kt b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/collections/entity/transformer/UpdateDataStateTransformer.kt index c5eec23071..77f0c846ee 100644 --- a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/collections/entity/transformer/UpdateDataStateTransformer.kt +++ b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/collections/entity/transformer/UpdateDataStateTransformer.kt @@ -61,7 +61,25 @@ internal class UpdateDataStateTransformer( state: NFTCollectionsStateUM, query: String, ): ImmutableList = mapNotNull { - if (query.isEmpty() || it.name?.lowercase()?.contains(query.lowercase()) == true) { + val assetsFulfillQuery = if (query.isEmpty()) { + true + } else { + when (val assets = it.assets) { + is NFTCollection.Assets.Empty, + is NFTCollection.Assets.Failed, + is NFTCollection.Assets.Loading, + -> true + is NFTCollection.Assets.Value -> { + assets.items.any { asset -> + asset.name?.lowercase()?.contains(query.lowercase()) == true + } + } + } + } + + val collectionFulfillQuery = query.isEmpty() || it.name?.lowercase()?.contains(query.lowercase()) == true + + if (collectionFulfillQuery || assetsFulfillQuery) { NFTCollectionUM( id = it.id.toString(), networkIconId = getActiveIconRes(it.network.id.value),