From a4a1231e92a58f5c08396aff4190e43b13b953a6 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 28 Jun 2023 07:03:53 +0200 Subject: [PATCH] gui: Remove tilde auto-expansions (fixes #8890) (#8954) This removes the tilde expansion we had in the GUI. I'm not sure why we had it, but there are valid reasons to have a folder path with tilde in it in the config, and it was previously impossible to enter one of those. --- gui/default/syncthing/core/syncthingController.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index a681eb8bc..208cb5617 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -740,20 +740,12 @@ angular.module('syncthing.core') } function pathJoin(base, name) { - base = expandTilde(base); if (base[base.length - 1] !== $scope.system.pathSeparator) { return base + $scope.system.pathSeparator + name; } return base + name; } - function expandTilde(path) { - if (path && path.trim().charAt(0) === '~') { - return $scope.system.tilde + path.trim().substring(1); - } - return path; - } - function shouldSetDefaultFolderPath() { return $scope.config.defaults.folder.path && $scope.folderEditor.folderPath.$pristine && $scope.editingFolderNew(); } @@ -1988,7 +1980,7 @@ angular.module('syncthing.core') if (!newvalue) { return; } - $scope.currentFolder.path = expandTilde(newvalue); + $scope.currentFolder.path = newvalue; $http.get(urlbase + '/system/browse', { params: { current: newvalue } }).success(function (data) {