fix reversed search suggestions

This commit is contained in:
Bnyro 2022-12-10 12:49:22 +01:00
parent f66e30cd70
commit 7f76799380

View File

@ -69,14 +69,13 @@ class SearchFragment : BaseFragment() {
val response = try { val response = try {
RetrofitInstance.api.getSuggestions(query) RetrofitInstance.api.getSuggestions(query)
} catch (e: Exception) { } catch (e: Exception) {
println(e)
Log.e(TAG(), e.toString()) Log.e(TAG(), e.toString())
return@launchWhenCreated return@launchWhenCreated
} }
// only load the suggestions if the input field didn't get cleared yet // only load the suggestions if the input field didn't get cleared yet
val suggestionsAdapter = val suggestionsAdapter =
SearchSuggestionsAdapter( SearchSuggestionsAdapter(
response, response.reversed(),
(activity as MainActivity).searchView (activity as MainActivity).searchView
) )
runOnUiThread { runOnUiThread {