浏览代码

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

Quentin Hibon 4 年之前
父节点
当前提交
ade8d79d42

+ 5 - 1
gui/default/syncthing/core/syncthingController.js

@@ -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);
             };
 

+ 5 - 1
gui/default/untrusted/syncthing/core/syncthingController.js

@@ -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);
             };