Skip to content

Commit

Permalink
Deduplicate recent searches vs suggestion.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrant committed Nov 22, 2024
1 parent 6360ca5 commit af80e5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object RabbitHolesEvent {
)).orEmpty(),
WikipediaApp.instance.languageState.appLanguageCode,
wikiId,
"rabbit_holes"
"app_rabbit_holes"
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class RecentSearchesFragment : Fragment() {
val searches: List<RecentSearch> = AppDatabase.instance.recentSearchDao().getRecentSearches()

recentSearchList.clear()
recentSearchList.addAll(searches)
recentSearchList.addAll(if (suggestedSearchTerm.isNullOrEmpty()) searches else searches.filter { it.text != suggestedSearchTerm })

val searchesEmpty = recentSearchList.isEmpty() && suggestedSearchTerm.isNullOrEmpty()
binding.namespacesRecycler.adapter = NamespaceAdapter()
Expand Down

0 comments on commit af80e5d

Please sign in to comment.