1
0
Эх сурвалжийг харах

gui: Change rescan interval only if fs watcher was actually toggled (fixes #4944) (#4946)

Simon Frei 7 жил өмнө
parent
commit
81f9a81c7d

+ 3 - 3
gui/default/syncthing/core/syncthingController.js

@@ -1506,13 +1506,13 @@ angular.module('syncthing.core')
             $scope.currentFolder.path = pathJoin($scope.config.options.defaultFolderPath, newvalue);
         });
 
-        $scope.$watch('currentFolder.fsWatcherEnabled', function (newvalue) {
-            if (newvalue) {
+        $scope.fsWatcherToggled = function () {
+            if ($scope.currentFolder.fsWatcherEnabled) {
                 $scope.currentFolder.rescanIntervalS = 3600;
             } else {
                 $scope.currentFolder.rescanIntervalS = 60;
             }
-        });
+        };
 
         $scope.loadFormIntoScope = function (form) {
             console.log('loadFormIntoScope',form.$name);

+ 1 - 1
gui/default/syncthing/folder/editFolderModalView.html

@@ -139,7 +139,7 @@
               &nbsp;<a href="https://docs.syncthing.net/users/syncing.html#scanning" target="_blank"><span class="fa fa-book"></span>&nbsp;<span translate>Help</span></a></br>
               <div class="row">
                 <div class="col-md-6">
-                  <input type="checkbox" ng-model="currentFolder.fsWatcherEnabled" tooltip data-original-title="{{'Use notifications from the filesystem to detect changed items.' | translate }}">&nbsp;<span translate>Watch for Changes</span>
+                  <input type="checkbox" ng-model="currentFolder.fsWatcherEnabled" ng-change="fsWatcherToggled()" tooltip data-original-title="{{'Use notifications from the filesystem to detect changed items.' | translate }}">&nbsp;<span translate>Watch for Changes</span>
                 </div>
                 <div class="col-md-6">
                   <div class="row">