mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Merge pull request #1299 from matkam/hide-unmon-no-msg
only hide unmonitored nodes when no messages
This commit is contained in:
commit
a373ef1975
1 changed files with 4 additions and 1 deletions
|
|
@ -337,7 +337,10 @@ struct FilteredUserList<Content: View>: View {
|
|||
}
|
||||
}
|
||||
// Always apply unmessagable and connected node filters
|
||||
let isUnmessagablePredicate = NSPredicate(format: "unmessagable == NO")
|
||||
// Show unmessagable nodes only if they have messages, otherwise hide them
|
||||
let unmessagablePredicate = NSPredicate(format: "unmessagable == NO")
|
||||
let hasMessagesPredicate = NSPredicate(format: "receivedMessages.@count > 0 OR sentMessages.@count > 0")
|
||||
let isUnmessagablePredicate = NSCompoundPredicate(type: .or, subpredicates: [unmessagablePredicate, hasMessagesPredicate])
|
||||
predicates.append(isUnmessagablePredicate)
|
||||
let isIgnoredPredicate = NSPredicate(format: "userNode.ignored == NO")
|
||||
predicates.append(isIgnoredPredicate)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue