gui: Don't save ignores if they haven't been loaded (fixes #4915) (#4930)

This commit is contained in:
Audrius Butkevicius 2018-05-08 22:39:17 +01:00 committed by Jakob Borg
parent a48a31e3f5
commit baa3aa4bad
1 changed files with 2 additions and 1 deletions

View File

@ -1699,6 +1699,7 @@ angular.module('syncthing.core')
delete folderCfg.versioning;
}
var ignoresLoaded = !$('#folder-ignores textarea').is(':disabled');
var ignores = $('#folder-ignores textarea').val().split('\n');
// Split always returns a minimum 1-length array even for no patterns
if (ignores.length === 1 && ignores[0] === "") {
@ -1711,7 +1712,7 @@ angular.module('syncthing.core')
$scope.folders[folderCfg.id] = folderCfg;
$scope.config.folders = folderList($scope.folders);
if ($scope.editingExisting && ignores !== folderCfg.ignores) {
if (ignoresLoaded && $scope.editingExisting && ignores !== folderCfg.ignores) {
saveIgnores(ignores);
};