Updated on 2026-08-14
This commit is contained in:
parent
cb04ddc533
commit
47a30176a6
2 changed files with 20 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -61,7 +61,25 @@ internal class UpdateDataStateTransformer(
|
|||
state: NFTCollectionsStateUM,
|
||||
query: String,
|
||||
): ImmutableList<NFTCollectionUM> = 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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue