Skip to content

Commit

Permalink
Fix history items not correctly filtered
Browse files Browse the repository at this point in the history
  • Loading branch information
CrisBarreiro committed May 15, 2024
1 parent 7c618f7 commit c2caede
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class AutoCompleteApi @Inject constructor(
getHistoryResults(query),
) { bookmarksAndFavorites, historyItems ->
val searchHistory = historyItems.filter { it.suggestion is AutoCompleteHistorySearchSuggestion }
val navigationHistory = historyItems.filterIsInstance<RankedSuggestion<AutoCompleteHistorySuggestion>>()
val navigationHistory = historyItems
.filter { it.suggestion is AutoCompleteHistorySuggestion } as List<RankedSuggestion<AutoCompleteHistorySuggestion>>
(removeDuplicates(navigationHistory, bookmarksAndFavorites) + searchHistory).sortedByDescending { it.score }.map { it.suggestion }
}

Expand Down

0 comments on commit c2caede

Please sign in to comment.