Merge branch 'fixLoadingSpeed'

This commit is contained in:
brantje 2017-10-29 16:26:08 +01:00
commit 812c88ec8c
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
2 changed files with 15 additions and 2 deletions

View file

@ -21,5 +21,4 @@ tools:
build_failure_conditions:
- 'issues.label("coding-style").new.count > 5'
- 'issues.severity(>= MAJOR).new.exists'
- 'elements.rating(<= D).new.exists'
- 'project.metric("scrutinizer.quality", < 7.5)'

View file

@ -58,6 +58,9 @@
vault.credentials = [];
$scope.active_vault = vault;
$scope.active_vault.vaultKey = vaultKey;
if(!$rootScope.vaultCache){
$rootScope.vaultCache = [];
}
VaultService.setActiveVault($scope.active_vault);
for (var i = 0; i < _credentials.length; i++) {
var _credential = _credentials[i];
@ -103,6 +106,7 @@
angular.merge($scope.active_vault.credentials, _credentials);
$scope.show_spinner = false;
$rootScope.$broadcast('credentials_loaded');
$rootScope.vaultCache[$scope.active_vault.guid] = angular.copy($scope.active_vault);
if(!vault.private_sharing_key){
var key_size = 1024;
ShareService.generateRSAKeys(key_size).then(function (kp) {
@ -135,13 +139,20 @@
var refresh_data_interval = null;
if ($scope.active_vault) {
$scope.$parent.selectedVault = true;
if($rootScope.vaultCache && $rootScope.vaultCache[$scope.active_vault.guid]){
$scope.active_vault = $rootScope.vaultCache[$scope.active_vault.guid];
$rootScope.$broadcast('credentials_loaded');
$scope.show_spinner = false;
} else {
fetchCredentials();
}
getPendingShareRequests();
refresh_data_interval = $interval(function () {
fetchCredentials();
getPendingShareRequests();
}, 60000 * 5);
}
$scope.$on('$destroy', function () {
$interval.cancel(refresh_data_interval);
});
@ -399,6 +410,9 @@
};
$rootScope.$on('logout', function () {
if($scope.active_vault) {
$rootScope.vaultCache[$scope.active_vault.guid] = null;
}
$scope.active_vault = null;
$scope.credentials = [];
// $scope.$parent.selectedVault = false;