diff options
author | brantje <brantje@gmail.com> | 2016-10-05 15:46:18 +0300 |
---|---|---|
committer | brantje <brantje@gmail.com> | 2016-10-05 15:46:18 +0300 |
commit | e1404ed2029e1ab0341254570dd309e82da57eed (patch) | |
tree | f14a69d8da583e607cdaafdac84115fa6b5b76f9 | |
parent | 6a38da7698977213841e7ec5cfde0b133f827e48 (diff) |
Little fixes in revision controller
-rw-r--r-- | js/app/controllers/revision.js | 18 |
1 files 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); |