Allow searching with + prefix.

This commit is contained in:
Michelle Tang
2025-02-11 14:10:51 -05:00
committed by Greyson Parrelli
parent 48cac37914
commit 02d4b1897e

View File

@@ -35,7 +35,7 @@ class CountryCodeViewModel : ViewModel() {
query = filterBy,
filteredList = state.value.countryList.filter { country: Country ->
country.name.contains(filterBy, ignoreCase = true) ||
country.countryCode.toString().contains(filterBy) ||
country.countryCode.toString().contains(filterBy.removePrefix("+")) ||
(filterBy.equals("usa", ignoreCase = true) && country.name.equals("United States", ignoreCase = true))
}
)