Skip file moving if location unchanged

This commit is contained in:
Johannes Zellner
2020-11-07 23:00:08 +01:00
parent 6a43e184e8
commit b5fa60235d

View File

@@ -223,6 +223,8 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
var oldFilePath = sanitize($scope.cwd + '/' + dataTransfer.getData('application/cloudron-filemanager'));
var newFilePath = sanitize(targetFolder + '/' + dataTransfer.getData('application/cloudron-filemanager'));
if (oldFilePath === newFilePath) return;
return Client.filesRename($scope.id, $scope.type, oldFilePath, newFilePath, function (error) {
if (error) return Client.error(error);
$scope.refresh();