Fixed duplicate searched items are showing

This commit is contained in:
MohitMali 2023-08-01 20:01:46 +05:30
parent 90e7e8d7f7
commit 9cfe35a95e

View File

@ -141,7 +141,7 @@ class SearchFragment : BaseFragment() {
if (fetchMoreSearchResults?.isNotEmpty() == true) { if (fetchMoreSearchResults?.isNotEmpty() == true) {
// Check if there is no duplicate entry, this is specially added for searched history items. // Check if there is no duplicate entry, this is specially added for searched history items.
val nonDuplicateResults = fetchMoreSearchResults.filter { newItem -> val nonDuplicateResults = fetchMoreSearchResults.filter { newItem ->
searchAdapter?.items?.any { it != newItem } == true searchAdapter?.items?.none { it == newItem } ?: true
} }
// Append new data (non-duplicate items) to the existing dataset // Append new data (non-duplicate items) to the existing dataset