fix crash

This commit is contained in:
Mathew Kamkar 2025-07-05 10:49:10 -07:00
parent b877aafc3f
commit 1e6cbcf06f

View file

@ -337,8 +337,8 @@ struct FilteredUserList<Content: View>: View {
}
}
// Always apply unmessagable and connected node filters
// Only hide unmessagable nodes if they have 0 messages
let isUnmessagablePredicate = NSPredicate(format: "unmessagable == NO AND (SUBQUERY(messageList, $msg, $msg.messageId != nil).@count == 0)")
// Show unmessagable nodes only if they have messages, otherwise hide them
let isUnmessagablePredicate = NSPredicate(format: "unmessagable == NO OR ((SUBQUERY(receivedMessages, $msg, $msg.messageId != nil).@count > 0) OR (SUBQUERY(sentMessages, $msg, $msg.messageId != nil).@count > 0))")
predicates.append(isUnmessagablePredicate)
let isIgnoredPredicate = NSPredicate(format: "userNode.ignored == NO")
predicates.append(isIgnoredPredicate)