From 746f1c4902cf80e39afafdeb125fd550da859d01 Mon Sep 17 00:00:00 2001 From: Daniel Bernal Date: Sat, 13 Jul 2024 12:59:33 +0200 Subject: [PATCH] Fixes an issue where incorrect item is deleted if the list is filtered --- Bouncer.xcodeproj/project.pbxproj | 8 ++++---- Bouncer/Views/FilterList/FilterListView.swift | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Bouncer.xcodeproj/project.pbxproj b/Bouncer.xcodeproj/project.pbxproj index b16b6ce..16a77e5 100644 --- a/Bouncer.xcodeproj/project.pbxproj +++ b/Bouncer.xcodeproj/project.pbxproj @@ -691,7 +691,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = SMSFilter/SMSFilter.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1031; + CURRENT_PROJECT_VERSION = 1034; DEVELOPMENT_TEAM = JM9222EF99; INFOPLIST_FILE = SMSFilter/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -714,7 +714,7 @@ CODE_SIGN_ENTITLEMENTS = SMSFilter/SMSFilter.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1031; + CURRENT_PROJECT_VERSION = 1034; DEVELOPMENT_TEAM = JM9222EF99; INFOPLIST_FILE = SMSFilter/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -860,7 +860,7 @@ CODE_SIGN_ENTITLEMENTS = Bouncer/Bouncer.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1031; + CURRENT_PROJECT_VERSION = 1034; DEVELOPMENT_ASSET_PATHS = "\"Bouncer/Preview Content\""; DEVELOPMENT_TEAM = JM9222EF99; ENABLE_PREVIEWS = YES; @@ -891,7 +891,7 @@ CODE_SIGN_ENTITLEMENTS = Bouncer/Bouncer.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1031; + CURRENT_PROJECT_VERSION = 1034; DEVELOPMENT_ASSET_PATHS = "\"Bouncer/Preview Content\""; DEVELOPMENT_TEAM = JM9222EF99; ENABLE_PREVIEWS = YES; diff --git a/Bouncer/Views/FilterList/FilterListView.swift b/Bouncer/Views/FilterList/FilterListView.swift index 9090b5f..ce6187b 100644 --- a/Bouncer/Views/FilterList/FilterListView.swift +++ b/Bouncer/Views/FilterList/FilterListView.swift @@ -123,7 +123,9 @@ extension FilterListView { } }.onDelete { indices in for index in indices { - let deletedItem = filteredFilters[index] + let deletedItem = filteredFilters.filter { + searchText.isEmpty || + $0.phrase.localizedCaseInsensitiveContains(searchText) }[index] onDelete(deletedItem.id) } }