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

This commit is contained in:
Simon Frei 2018-05-17 09:21:10 +02:00 committed by Jakob Borg
parent 127c891526
commit 81f9a81c7d
2 changed files with 4 additions and 4 deletions

View File

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

View File

@ -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">