fixup! Rewrite search suggestion with kotlin flow, remove suggestion limit

This commit is contained in:
tarsin committed 2022-12-17 13:08:08 +08:00
1 parent 7c1a297a99
commit b1a9601ae9
1 file changed
+3 -5
@@ -287,12 +287,10 @@ abstract class SearchBarScene : ToolbarScene() {
@SuppressLint("NotifyDataSetChanged")
private fun updateSuggestions(scrollToTop: Boolean = true) {
viewLifecycleOwner.lifecycleScope.launch {
viewLifecycleOwner.lifecycleScope.launch(Dispatchers.Default) {
val suggestions = mutableListOf<Suggestion>()
withContext(Dispatchers.Default) {
mergedSuggestionFlow().collect {
suggestions.add(it)
}
mergedSuggestionFlow().collect {
suggestions.add(it)
}
withContext(Dispatchers.Main) {
mSuggestionList = suggestions