Skip to content

Commit

Permalink
fix(privacy): Filter search case sensitivity (#25675)
Browse files Browse the repository at this point in the history
Fix filter search being case-sensitive.
  • Loading branch information
StephenHeaps authored Sep 20, 2024
1 parent 6bf0b59 commit a8c6459
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ struct FilterListsView: View {
}

@ViewBuilder private var defaultFilterListRows: some View {
let searchText = searchText.lowercased()
let searchText = searchText
#if DEBUG
let allEnabled = Binding {
filterListStorage.filterLists.allSatisfy({
Expand Down Expand Up @@ -385,13 +385,14 @@ struct FilterListsView_Previews: PreviewProvider {
extension FilterList {
fileprivate func satisfies(searchText: String) -> Bool {
guard !searchText.isEmpty else { return true }
return entry.title.contains(searchText) || entry.desc.contains(searchText)
return entry.title.localizedCaseInsensitiveContains(searchText)
|| entry.desc.localizedCaseInsensitiveContains(searchText)
}
}

extension FilterListCustomURL {
@MainActor fileprivate func satisfies(searchText: String) -> Bool {
guard !searchText.isEmpty else { return true }
return setting.externalURL.absoluteString.contains(searchText)
return setting.externalURL.absoluteString.localizedCaseInsensitiveContains(searchText)
}
}

0 comments on commit a8c6459

Please sign in to comment.