Browse Source

Sort nodes on name if set, otherwise ID (fixes #119)

Jakob Borg 11 years ago
parent
commit
935a8eb9a7
1 changed files with 4 additions and 5 deletions
  1. 4 5
      gui/app.js

+ 4 - 5
gui/app.js

@@ -54,11 +54,10 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
     }
 
     function nodeCompare(a, b) {
-        if (a.NodeID === $scope.myID) {
-            return -1;
-        }
-        if (b.NodeID === $scope.myID) {
-            return 1;
+        if (typeof a.Name !== 'undefined' && typeof b.Name !== 'undefined') {
+            if (a.Name < b.Name)
+                return -1;
+            return a.Name > b.Name;
         }
         if (a.NodeID < b.NodeID) {
             return -1;