Merge pull request #1299 from matkam/hide-unmon-no-msg

only hide unmonitored nodes when no messages
This commit is contained in:
Garth Vander Houwen 2025-07-09 13:49:02 -07:00 committed by GitHub
commit a373ef1975
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)