From 098d1ca5d41f5212d1c32c73d2d882eaaa3ec020 Mon Sep 17 00:00:00 2001 From: fnuesse Date: Wed, 2 Jan 2019 12:48:12 +0100 Subject: [PATCH] Fixed foldermoving failing because encrypted credential was passed Signed-off-by: fnuesse --- js/app/controllers/credential.js | 2 +- js/app/directives/folderpicker.js | 5 +++++ js/app/services/folderservice.js | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/js/app/controllers/credential.js b/js/app/controllers/credential.js index a20bf68a..b6d9b63e 100644 --- a/js/app/controllers/credential.js +++ b/js/app/controllers/credential.js @@ -468,7 +468,7 @@ }; $rootScope.$on('updateFolderInMainList', function (evt, updated_credential) { - + CredentialService.decryptCredential(updated_credential); for (var i = 0; i < $scope.active_vault.credentials.length; i++) { if($scope.active_vault.credentials[i].guid === updated_credential.guid){ $scope.active_vault.credentials[i]=updated_credential; diff --git a/js/app/directives/folderpicker.js b/js/app/directives/folderpicker.js index 23e8fdbf..d2b4fb18 100644 --- a/js/app/directives/folderpicker.js +++ b/js/app/directives/folderpicker.js @@ -49,6 +49,11 @@ }; scope.save = function() { + while(scope.currentFolder.includes('//')){ + _credential.folderpath=_credential.folderpath.replace("//", "/"); + } + scope.credential.folderpath = scope.currentFolder; + CredentialService.updateCredential(scope.credential).then(function (updated_credential) { NotificationService.showNotification($translate.instant('folderpath.moved'), 5000); $rootScope.$broadcast('updateFolderInMainList', updated_credential); diff --git a/js/app/services/folderservice.js b/js/app/services/folderservice.js index d4fe72c9..68a98837 100644 --- a/js/app/services/folderservice.js +++ b/js/app/services/folderservice.js @@ -49,6 +49,10 @@ angular.module('passmanApp') var _credential = CredentialList[i]; if (_credential.folderpath !== null) { + while(_credential.folderpath.includes('//')){ + _credential.folderpath=_credential.folderpath.replace("//", "/"); + } + console.log(_credential.folderpath); if (String(_credential.folderpath).startsWith(String($scope.currentFolder)) || update) { if ($scope.FolderList.indexOf(_credential.folderpath) <= -1) { $scope.FolderList.push(_credential.folderpath);