From 16839713e5d89d602efc2b57212a97af35d85bb4 Mon Sep 17 00:00:00 2001 From: binsky Date: Fri, 12 Mar 2021 16:26:34 +0100 Subject: implement global nextcloud search credential handling --- js/app/controllers/credential.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'js/app') 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; }; -- cgit v1.2.3