From 28d7b683f4eadafda726cde4d0f207a309474779 Mon Sep 17 00:00:00 2001 From: binsky Date: Tue, 17 Aug 2021 15:39:47 +0200 Subject: fix bookmarklet Signed-off-by: binsky --- js/app/controllers/bookmarklet.js | 6 +++++- js/app/controllers/settings.js | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'js/app') diff --git a/js/app/controllers/bookmarklet.js b/js/app/controllers/bookmarklet.js index a1d292bd..6673dba2 100644 --- a/js/app/controllers/bookmarklet.js +++ b/js/app/controllers/bookmarklet.js @@ -411,9 +411,13 @@ NotificationService.showNotification($translate.instant('credential.created'), 5000); }); } + setTimeout(() => window.close(), 3000); }; + $scope.cancel = function () { + window.close(); + }; } ]); -}()); \ No newline at end of file +}()); diff --git a/js/app/controllers/settings.js b/js/app/controllers/settings.js index 750b41a4..9fa1f155 100644 --- a/js/app/controllers/settings.js +++ b/js/app/controllers/settings.js @@ -87,8 +87,8 @@ }); var btn_txt = $translate.instant('bookmarklet.text'); - var http = location.protocol, slashes = http.concat("//"), host = slashes.concat(window.location.hostname), complete = host + location.pathname; - $scope.bookmarklet = $sce.trustAsHtml("" + btn_txt + ""); + var http = location.protocol, slashes = http.concat("//"), host = slashes.concat(window.location.hostname + ":" + window.location.port), complete = host + location.pathname; + $scope.bookmarklet = $sce.trustAsHtml("" + btn_txt + ""); $scope.saveVaultSettings = function () { @@ -322,4 +322,4 @@ }]); -}()); \ No newline at end of file +}()); -- cgit v1.2.3 From 39a712ca428ada4244c24a569afb4bfba1f91e03 Mon Sep 17 00:00:00 2001 From: binsky Date: Tue, 17 Aug 2021 16:47:19 +0200 Subject: fix blocking vault export if a download or decryption failed Signed-off-by: binsky --- js/app/controllers/export.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'js/app') diff --git a/js/app/controllers/export.js b/js/app/controllers/export.js index b284048c..f152b506 100644 --- a/js/app/controllers/export.js +++ b/js/app/controllers/export.js @@ -72,15 +72,19 @@ if (vault.hasOwnProperty('credentials')) { if (vault.credentials.length > 0) { for (var i = 0; i < vault.credentials.length; i++) { - var _credential = angular.copy(vault.credentials[i]); - if (_credential.hidden === 0) { - var key = CredentialService.getSharedKeyFromCredential(_credential); - _credential = CredentialService.decryptCredential(_credential, key); - _credential.vault_key = key; - _credentials.push(_credential); + try { + var _credential = angular.copy(vault.credentials[i]); + if (_credential.hidden === 0) { + var key = CredentialService.getSharedKeyFromCredential(_credential); + _credential = CredentialService.decryptCredential(_credential, key); + _credential.vault_key = key; + _credentials.push(_credential); + } + } catch (e) { + _log($translate.instant('export.decrypt.error', {credential: (vault.credentials[i].label !== undefined) ? vault.credentials[i].label : i})); } } - $window.PassmanExporter[$scope.selectedExporter.id].export(_credentials, FileService, EncryptService).then(function () { + $window.PassmanExporter[$scope.selectedExporter.id].export(_credentials, FileService, EncryptService, $scope.log, $translate).then(function () { _log($translate.instant('done')); }); } @@ -92,4 +96,4 @@ }]); -}()); \ No newline at end of file +}()); -- cgit v1.2.3