diff options
Diffstat (limited to 'js/app/controllers/credential.js')
-rw-r--r-- | js/app/controllers/credential.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/app/controllers/credential.js b/js/app/controllers/credential.js index 3c70736a..9d84f33c 100644 --- a/js/app/controllers/credential.js +++ b/js/app/controllers/credential.js @@ -118,6 +118,7 @@ VaultService.updateSharingKeys($scope.active_vault); }); } + $scope.checkURLAction(); }); }); }; @@ -544,6 +545,24 @@ VaultService.clearVaultService(); }); + $scope.$watch(function(){ return $location.search(); }, function(params){ + $scope.checkURLAction(); + }); + + $scope.checkURLAction = function () { + var search = $location.search(); + if (search.show !== undefined && $scope.active_vault.credentials !== undefined && + $scope.active_vault.credentials.length > 0) { + $scope.closeSelected(); + $scope.active_vault.credentials.forEach(function(credential, index, myArray) { + if (credential.guid === search.show) { + $scope.selectCredential(credential); + return true; + } + }); + } + }; + $scope.clearState = function () { $scope.delete_time = 0; }; |