gui: Do not touch .stignore when not needed (fixes #7284) (#7325)

This commit is contained in:
Quentin Hibon 2021-02-03 20:58:24 +01:00 committed by GitHub
parent 42917d707d
commit ade8d79d42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -2019,7 +2019,11 @@ angular.module('syncthing.core')
$scope.folders[folderCfg.id] = folderCfg;
$scope.config.folders = folderList($scope.folders);
if (ignoresLoaded && $scope.editingExisting && ignores !== folderCfg.ignores) {
function arrayEquals(a, b) {
return a.length === b.length && a.every(function(v, i) { return v === b[i] });
}
if (ignoresLoaded && $scope.editingExisting && !arrayEquals(ignores, folderCfg.ignores)) {
saveIgnores(ignores);
};

View File

@ -2037,7 +2037,11 @@ angular.module('syncthing.core')
$scope.folders[folderCfg.id] = folderCfg;
$scope.config.folders = folderList($scope.folders);
if (ignoresLoaded && $scope.editingExisting && ignores !== folderCfg.ignores) {
function arrayEquals(a, b) {
return a.length === b.length && a.every(function(v, i) { return v === b[i] });
}
if (ignoresLoaded && $scope.editingExisting && !arrayEquals(ignores, folderCfg.ignores)) {
saveIgnores(ignores);
};