diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index c19b9f43..2fee612a 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -1279,6 +1279,13 @@ angular.module('syncthing.core') $scope.protocolChanged = true; } + // Parse strings to arrays before copying over + ['listenAddresses', 'globalAnnounceServers'].forEach(function (key) { + $scope.tmpOptions[key] = $scope.tmpOptions["_" + key + "Str"].split(/[ ,]+/).map(function (x) { + return x.trim(); + }); + }); + // Apply new settings locally $scope.thisDeviceIn($scope.tmpDevices).name = $scope.tmpOptions.deviceName; $scope.config.options = angular.copy($scope.tmpOptions); @@ -1292,12 +1299,6 @@ angular.module('syncthing.core') // here as well... $scope.devices = $scope.config.devices; - ['listenAddresses', 'globalAnnounceServers'].forEach(function (key) { - $scope.config.options[key] = $scope.config.options["_" + key + "Str"].split(/[ ,]+/).map(function (x) { - return x.trim(); - }); - }); - $scope.saveConfig(function () { if (themeChanged) { document.location.reload(true);