security preferences in wallet preferences

This commit is contained in:
Gabriel Bazán 2015-11-18 15:14:09 -03:00
commit eef61bfd51
6 changed files with 84 additions and 74 deletions

View file

@ -2,7 +2,13 @@
angular.module('copayApp.controllers').controller('preferencesController',
function($scope, $rootScope, $timeout, $log, configService, profileService) {
var fc = profileService.focusedClient;
$scope.deleted = false;
if (fc.credentials && !fc.credentials.mnemonicEncrypted && !fc.credentials.mnemonic) {
$scope.deleted = true;
}
this.init = function() {
var config = configService.getSync();
var fc = profileService.focusedClient;
@ -37,8 +43,8 @@ angular.module('copayApp.controllers').controller('preferencesController',
});
});
} else {
if (!val && fc.hasPrivKeyEncrypted()) {
profileService.unlockFC(function(err){
if (!val && fc.hasPrivKeyEncrypted()) {
profileService.unlockFC(function(err) {
if (err) {
$scope.encrypt = true;
return;
@ -70,14 +76,13 @@ angular.module('copayApp.controllers').controller('preferencesController',
opts.touchIdFor[walletId] = newVal;
$rootScope.$emit('Local/RequestTouchid', function(err) {
if (err) {
if (err) {
$log.debug(err);
$timeout(function() {
$scope.touchidError = true;
$scope.touchid = oldVal;
}, 100);
}
else {
} else {
configService.set(opts, function(err) {
if (err) {
$log.debug(err);

View file

@ -286,18 +286,6 @@ angular
}
})
.state('securityPreferences', {
url: '/securityPreferences',
templateUrl: 'views/securityPreferences.html',
walletShouldBeComplete: true,
needProfile: true,
views: {
'main': {
templateUrl: 'views/securityPreferences.html'
},
}
})
.state('preferencesAdvanced', {
url: '/preferencesAdvanced',
templateUrl: 'views/preferencesAdvanced.html',