Sort nodes with unknown hops last (#1302)

Nodes with -1 hops (unknown) are now sorted last when sorting by hops_away. This ensures a more intuitive ordering
 in the UI.
This commit is contained in:
James Rich 2024-10-11 05:54:06 -05:00 committed by GitHub
parent 9bd84d3fc0
commit cf2315cb66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -63,7 +63,11 @@ interface NodeInfoDao {
(longitude - (SELECT longitude FROM OurNode)) *
(longitude - (SELECT longitude FROM OurNode))
END
WHEN :sort = 'hops_away' THEN hops_away
WHEN :sort = 'hops_away' THEN
CASE
WHEN hops_away = -1 THEN 999999999
ELSE hops_away
END
WHEN :sort = 'channel' THEN channel
WHEN :sort = 'via_mqtt' THEN long_name LIKE '%(MQTT)' -- viaMqtt
ELSE 0