Skip to content

Commit

Permalink
Fix saving search suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszkwiecinski committed Feb 4, 2022
1 parent 408d5de commit f3fd78b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class SearchFragment : BaseFragment(R.layout.activity_search) {

callback()
searchView.clearFocus()
querySubject.onNext(query)
querySubject.onNext(URLEncoder.encode(query, "UTF-8"))
activity?.hideKeyboard()

return true
Expand All @@ -92,7 +92,7 @@ class SearchFragment : BaseFragment(R.layout.activity_search) {
override fun onQueryTextChange(newText: String?): Boolean {
val results = runBlocking {
val searchDetails = getSearchDetails().first()
searchDetails.onQueryChanged(URLEncoder.encode(newText, "UTF-8"))
searchDetails.onQueryChanged(newText.orEmpty())
getSearchDetails().first().searchResults.map { it.text }
}
suggestionsAdapter.clear()
Expand Down

0 comments on commit f3fd78b

Please sign in to comment.