From 54af67284b0690506ebc8654afb88b409cd0caa0 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Tue, 2 Jul 2024 08:01:13 -0700 Subject: [PATCH] Update Meshtastic/Views/Messages/UserList.swift Co-authored-by: Blake McAnally --- Meshtastic/Views/Messages/UserList.swift | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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 {