security preferences in wallet preferences
This commit is contained in:
parent
1c841e5f21
commit
eef61bfd51
6 changed files with 84 additions and 74 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue