improved readability

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Mathew Kamkar 2025-07-07 21:57:04 -07:00 committed by GitHub
parent 1d34f3293a
commit b2961edc53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -338,7 +338,9 @@ struct FilteredUserList<Content: View>: View {
}
// Always apply unmessagable and connected node filters
// Show unmessagable nodes only if they have messages, otherwise hide them
let isUnmessagablePredicate = NSPredicate(format: "unmessagable == NO OR (receivedMessages.@count > 0 OR sentMessages.@count > 0)")
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)