mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 11:58:28 +00:00
gui: Don't set default path editing existing folders without label (fixes #4297)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4298 LGTM: calmh
This commit is contained in:
parent
1fc2ab444b
commit
77578e8aac
@ -622,6 +622,10 @@ angular.module('syncthing.core')
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function shouldSetDefaultFolderPath() {
|
||||||
|
return $scope.config.options && $scope.config.options.defaultFolderPath && !$scope.editingExisting && $scope.folderEditor.folderPath.$pristine
|
||||||
|
}
|
||||||
|
|
||||||
$scope.neededPageChanged = function (page) {
|
$scope.neededPageChanged = function (page) {
|
||||||
$scope.neededCurrentPage = page;
|
$scope.neededCurrentPage = page;
|
||||||
refreshNeed($scope.neededFolder);
|
refreshNeed($scope.neededFolder);
|
||||||
@ -1388,14 +1392,14 @@ angular.module('syncthing.core')
|
|||||||
});
|
});
|
||||||
|
|
||||||
$scope.$watch('currentFolder.label', function (newvalue) {
|
$scope.$watch('currentFolder.label', function (newvalue) {
|
||||||
if (!$scope.config.options || !$scope.config.options.defaultFolderPath || $scope.editingExisting || !$scope.folderEditor.folderPath.$pristine || !newvalue) {
|
if (!newvalue || !shouldSetDefaultFolderPath()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$scope.currentFolder.path = pathJoin($scope.config.options.defaultFolderPath, newvalue);
|
$scope.currentFolder.path = pathJoin($scope.config.options.defaultFolderPath, newvalue);
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$watch('currentFolder.id', function (newvalue) {
|
$scope.$watch('currentFolder.id', function (newvalue) {
|
||||||
if (!$scope.config.options || !$scope.config.options.defaultFolderPath || !$scope.folderEditor.folderPath.$pristine || !newvalue || $scope.currentFolder.label) {
|
if (!newvalue || !shouldSetDefaultFolderPath() || $scope.currentFolder.label) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$scope.currentFolder.path = pathJoin($scope.config.options.defaultFolderPath, newvalue);
|
$scope.currentFolder.path = pathJoin($scope.config.options.defaultFolderPath, newvalue);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user