Update Meshtastic/Views/Messages/UserList.swift

Co-authored-by: Blake McAnally <bwm003@gmail.com>
This commit is contained in:
Garth Vander Houwen 2024-07-02 08:01:13 -07:00 committed by GitHub
parent 0ffd3a06d0
commit 54af67284b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -271,14 +271,13 @@ struct UserList: View {
predicates.append(compoundPredicate)
}
/// Hops Away
if hopsAway > -1.0 {
if hopsAway == 0.0 {
let hopsAwayPredicate = NSPredicate(format: "userNode.hopsAway == %i", Int32(hopsAway))
predicates.append(hopsAwayPredicate)
} else {
let hopsAwayPredicate = NSPredicate(format: "userNode.hopsAway > 0 AND userNode.hopsAway <= %i", Int32(hopsAway))
predicates.append(hopsAwayPredicate)
}
if hopsAway == 0.0 {
let hopsAwayPredicate = NSPredicate(format: "userNode.hopsAway == %i", Int32(hopsAway))
predicates.append(hopsAwayPredicate)
} else if hopsAway > -1.0 {
let hopsAwayPredicate = NSPredicate(format: "userNode.hopsAway > 0 AND userNode.hopsAway <= %i", Int32(hopsAway))
predicates.append(hopsAwayPredicate)
}
}
/// Online
if isOnline {