mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Clean up the filters
This commit is contained in:
parent
0b5e72cd43
commit
197b567db0
2 changed files with 11 additions and 11 deletions
|
|
@ -30,6 +30,15 @@ struct UserList: View {
|
|||
@State private var deviceRoles: Set<Int> = []
|
||||
@State var isEditingFilters = false
|
||||
@State private var showingTrustConfirm: Bool = false
|
||||
|
||||
var boolFilters: [Bool] {[
|
||||
isFavorite,
|
||||
isOnline,
|
||||
isPkiEncrypted,
|
||||
isEnvironment,
|
||||
distanceFilter,
|
||||
roleFilter
|
||||
]}
|
||||
|
||||
@FetchRequest(
|
||||
sortDescriptors: [NSSortDescriptor(key: "lastMessage", ascending: false),
|
||||
|
|
@ -210,21 +219,12 @@ struct UserList: View {
|
|||
.onChange(of: hopsAway) { _ in
|
||||
searchUserList()
|
||||
}
|
||||
.onChange(of: isOnline) { _ in
|
||||
searchUserList()
|
||||
}
|
||||
.onChange(of: isPkiEncrypted) { _ in
|
||||
searchUserList()
|
||||
}
|
||||
.onChange(of: isFavorite) { _ in
|
||||
.onChange(of: [boolFilters]) { _ in
|
||||
searchUserList()
|
||||
}
|
||||
.onChange(of: maxDistance) { _ in
|
||||
searchUserList()
|
||||
}
|
||||
.onChange(of: distanceFilter) { _ in
|
||||
searchUserList()
|
||||
}
|
||||
.onAppear {
|
||||
searchUserList()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ struct NodeList: View {
|
|||
await searchNodeList()
|
||||
}
|
||||
}
|
||||
.onChange(of: boolFilters) { _ in
|
||||
.onChange(of: [boolFilters]) { _ in
|
||||
Task {
|
||||
await searchNodeList()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue