gui: Don't remove the slash from path '/' (fixes #4983) (#4988)

This commit is contained in:
Simon Frei 2018-06-05 23:47:47 +02:00 committed by GitHub
parent ee6516aa31
commit b670b5550a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1548,7 +1548,7 @@ angular.module('syncthing.core')
$scope.editFolder = function (folderCfg) {
$scope.editingExisting = true;
$scope.currentFolder = angular.copy(folderCfg);
if ($scope.currentFolder.path.slice(-1) === $scope.system.pathSeparator) {
if ($scope.currentFolder.path.length > 1 && $scope.currentFolder.path.slice(-1) === $scope.system.pathSeparator) {
$scope.currentFolder.path = $scope.currentFolder.path.slice(0, -1);
}
$scope.currentFolder.selectedDevices = {};