Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(privacy): Filter search case sensitivity on iOS #25675

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
}
Loading