mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 14:48:30 +00:00
parent
9ef17322be
commit
79bf1f1056
@ -59,6 +59,7 @@ angular.module('syncthing.core')
|
||||
} catch (exception) { }
|
||||
|
||||
$scope.folderDefaults = {
|
||||
devices: [],
|
||||
sharedDevices: {},
|
||||
selectedDevices: {},
|
||||
unrelatedDevices: {},
|
||||
@ -1833,15 +1834,22 @@ angular.module('syncthing.core')
|
||||
$scope.saveFolder = function () {
|
||||
$('#editFolder').modal('hide');
|
||||
var folderCfg = angular.copy($scope.currentFolder);
|
||||
folderCfg.devices = [];
|
||||
folderCfg.selectedDevices[$scope.myID] = true;
|
||||
var newDevices = [];
|
||||
folderCfg.devices.forEach(function (dev) {
|
||||
if (folderCfg.selectedDevices[dev.deviceID] === true) {
|
||||
newDevices.push(dev);
|
||||
delete folderCfg.selectedDevices[dev.deviceID];
|
||||
};
|
||||
});
|
||||
for (var deviceID in folderCfg.selectedDevices) {
|
||||
if (folderCfg.selectedDevices[deviceID] === true) {
|
||||
folderCfg.devices.push({
|
||||
newDevices.push({
|
||||
deviceID: deviceID
|
||||
});
|
||||
}
|
||||
}
|
||||
folderCfg.devices = newDevices;
|
||||
delete folderCfg.sharedDevices;
|
||||
delete folderCfg.selectedDevices;
|
||||
delete folderCfg.unrelatedDevices;
|
||||
|
Loading…
x
Reference in New Issue
Block a user