Updated on 2026-08-14
This commit is contained in:
parent
fb7aa02b29
commit
a2fb7e2ce1
2 changed files with 17 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ class LoadAvailableCoinsService(
|
|||
if (isTestNet) {
|
||||
return Result.Success(
|
||||
LoadedCoins(
|
||||
currencies = currenciesRepository.getTestnetCoins(),
|
||||
currencies = currenciesRepository.getTestnetCoins().filter(searchInput),
|
||||
moreAvailable = false,
|
||||
)
|
||||
)
|
||||
|
|
@ -59,6 +59,15 @@ class LoadAvailableCoinsService(
|
|||
)
|
||||
}
|
||||
|
||||
private fun List<Currency>.filter(searchInput: String?): List<Currency> {
|
||||
if (searchInput.isNullOrBlank()) return this
|
||||
|
||||
return filter{
|
||||
it.symbol.contains(searchInput, ignoreCase = true) ||
|
||||
it.name.contains(searchInput, ignoreCase = true)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val LOAD_PER_PAGE = 100
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,13 @@ class AddTokensFragment : Fragment(R.layout.fragment_add_tokens),
|
|||
}
|
||||
|
||||
val onLoadMore = {
|
||||
store.dispatch(TokensAction.LoadCurrencies(scanResponse = store.state.globalState.scanResponse))
|
||||
if (store.state.tokensState.needToLoadMore) {
|
||||
store.dispatch(
|
||||
TokensAction.LoadCurrencies(
|
||||
scanResponse = store.state.globalState.scanResponse
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
cvCurrencies.setContent {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue