Sort the list alphabetticaly for bin search

This commit is contained in:
Joren
2024-04-30 01:52:35 +02:00
parent 0ebf26c457
commit fd122ec376

View File

@@ -29,7 +29,7 @@ class PokeSearchViewModel(private val favouritesRepository: FavouritesRepository
viewModelScope.launch {
try {
val response = service.getPokemon()
_initialPokemonList.value = response.results
_initialPokemonList.value = response.results.sortedBy { it.name.lowercase() }
} catch (e: IOException) {
/*TODO*/
}