diff --git a/Meshtastic/Views/Messages/UserList.swift b/Meshtastic/Views/Messages/UserList.swift index 96dd398e..d4bfdbf1 100644 --- a/Meshtastic/Views/Messages/UserList.swift +++ b/Meshtastic/Views/Messages/UserList.swift @@ -30,6 +30,15 @@ struct UserList: View { @State private var deviceRoles: Set = [] @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() } diff --git a/Meshtastic/Views/Nodes/NodeList.swift b/Meshtastic/Views/Nodes/NodeList.swift index f85cad48..310abc9b 100644 --- a/Meshtastic/Views/Nodes/NodeList.swift +++ b/Meshtastic/Views/Nodes/NodeList.swift @@ -302,7 +302,7 @@ struct NodeList: View { await searchNodeList() } } - .onChange(of: boolFilters) { _ in + .onChange(of: [boolFilters]) { _ in Task { await searchNodeList() }