From e1404ed2029e1ab0341254570dd309e82da57eed Mon Sep 17 00:00:00 2001 From: brantje Date: Wed, 5 Oct 2016 14:46:18 +0200 Subject: [PATCH] Little fixes in revision controller --- js/app/controllers/revision.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/js/app/controllers/revision.js b/js/app/controllers/revision.js index 5de9c639..5551d0fc 100644 --- a/js/app/controllers/revision.js +++ b/js/app/controllers/revision.js @@ -13,28 +13,18 @@ angular.module('passmanApp') if (!SettingsService.getSetting('defaultVault') || !SettingsService.getSetting('defaultVaultPass')) { if (!$scope.active_vault) { - $location.path('/') + // $location.path('/') } } else { if (SettingsService.getSetting('defaultVault') && SettingsService.getSetting('defaultVaultPass')) { var _vault = angular.copy(SettingsService.getSetting('defaultVault')); + _vault.vaultKey = SettingsService.getSetting('defaultVaultPass'); + VaultService.setActiveVault(_vault); VaultService.getVault(_vault).then(function (vault) { vault.vaultKey = SettingsService.getSetting('defaultVaultPass'); VaultService.setActiveVault(vault); $scope.active_vault = vault; $scope.$parent.selectedVault = true; - $scope.vault_settings.pwSettings = VaultService.getVaultSetting('pwSettings', - { - 'length': 12, - 'useUppercase': true, - 'useLowercase': true, - 'useDigits': true, - 'useSpecialChars': true, - 'minimumDigitCount': 3, - 'avoidAmbiguousCharacters': false, - 'requireEveryCharType': true, - 'generateOnCreate': true - }) }) } } @@ -46,6 +36,7 @@ angular.module('passmanApp') var getRevisions = function () { CredentialService.getRevisions($scope.storedCredential.credential_id).then(function (revisions) { + console.log(revisions) $scope.revisions = revisions; }) }; @@ -86,6 +77,7 @@ angular.module('passmanApp') $scope.restoreRevision = function (revision) { var _revision = angular.copy(revision); var _credential = _revision.credential_data; + //@TODO make sure the shared key doesn't get restored _credential.revision_created = $filter('date')(_revision.created * 1000 , "dd-MM-yyyy @ HH:mm:ss"); CredentialService.updateCredential(_credential).then(function (result) { SettingsService.setSetting('revision_credential', null);