diff --git a/Meshtastic/Views/Messages/UserList.swift b/Meshtastic/Views/Messages/UserList.swift index 19d3dc11..f6e30e81 100644 --- a/Meshtastic/Views/Messages/UserList.swift +++ b/Meshtastic/Views/Messages/UserList.swift @@ -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 {