gui: Fix discovered devices list (follow-up to #4186)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4239
This commit is contained in:
Simon Frei
2017-06-29 13:47:42 +00:00
committed by Jakob Borg
parent 34f8cc8620
commit 8d13e01342
2 changed files with 25 additions and 19 deletions

View File

@@ -1186,13 +1186,17 @@ angular.module('syncthing.core')
return $http.get(urlbase + '/system/discovery')
.success(function (registry) {
$scope.discovery = [];
outer:
for (var id in registry) {
if ($scope.discovery.length === 5) {
break;
}
if (!(id in $scope.devices)) {
$scope.discovery.push(id);
for (var i = 0; i < $scope.devices.length; i++) {
if ($scope.devices[i].deviceID === id) {
continue outer;
}
}
$scope.discovery.push(id);
}
})
.then(function () {