Fixed foldermoving failing because encrypted credential was passed

Signed-off-by: fnuesse <felix.nuesse@t-online.de>
This commit is contained in:
fnuesse 2019-01-02 12:48:12 +01:00
parent 2ac1b17bfb
commit 098d1ca5d4
No known key found for this signature in database
GPG key ID: 2089A3431243E819
3 changed files with 10 additions and 1 deletions

View file

@ -468,7 +468,7 @@
}; };
$rootScope.$on('updateFolderInMainList', function (evt, updated_credential) { $rootScope.$on('updateFolderInMainList', function (evt, updated_credential) {
CredentialService.decryptCredential(updated_credential);
for (var i = 0; i < $scope.active_vault.credentials.length; i++) { for (var i = 0; i < $scope.active_vault.credentials.length; i++) {
if($scope.active_vault.credentials[i].guid === updated_credential.guid){ if($scope.active_vault.credentials[i].guid === updated_credential.guid){
$scope.active_vault.credentials[i]=updated_credential; $scope.active_vault.credentials[i]=updated_credential;

View file

@ -49,6 +49,11 @@
}; };
scope.save = function() { 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) { CredentialService.updateCredential(scope.credential).then(function (updated_credential) {
NotificationService.showNotification($translate.instant('folderpath.moved'), 5000); NotificationService.showNotification($translate.instant('folderpath.moved'), 5000);
$rootScope.$broadcast('updateFolderInMainList', updated_credential); $rootScope.$broadcast('updateFolderInMainList', updated_credential);

View file

@ -49,6 +49,10 @@ angular.module('passmanApp')
var _credential = CredentialList[i]; var _credential = CredentialList[i];
if (_credential.folderpath !== null) { 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 (String(_credential.folderpath).startsWith(String($scope.currentFolder)) || update) {
if ($scope.FolderList.indexOf(_credential.folderpath) <= -1) { if ($scope.FolderList.indexOf(_credential.folderpath) <= -1) {
$scope.FolderList.push(_credential.folderpath); $scope.FolderList.push(_credential.folderpath);