gui: Refactor to make encryption diff smaller (#7049)

This commit is contained in:
Simon Frei
2020-10-23 08:27:02 +02:00
committed by GitHub
parent f0f60ba2e7
commit a20d85d451
6 changed files with 106 additions and 126 deletions
@@ -16,10 +16,7 @@ angular.module('syncthing.core')
}
});
//Prevents user from adding a duplicate ID
var matches = scope.devices.filter(function (n) {
return n.deviceID == viewValue;
}).length;
if (matches > 0) {
if ($scope.devices.hasOwnProperty(viewValue)) {
ctrl.$setValidity('unique', false);
} else {
ctrl.$setValidity('unique', true);