fix spending password toggle

This commit is contained in:
Gabriel Bazán 2017-06-05 09:31:38 -03:00
parent 63c789ee52
commit 80bc9a839f
1 changed files with 7 additions and 6 deletions

View File

@ -3,11 +3,7 @@
angular.module('copayApp.controllers').controller('preferencesController',
function($scope, $rootScope, $timeout, $log, $ionicHistory, configService, profileService, fingerprintService, walletService) {
var wallet;
var walletId;
$scope.encryptEnabled = {
value: walletService.isEncrypted(wallet)
};
var walletId;
$scope.hiddenBalanceChange = function() {
var opts = {
@ -22,6 +18,7 @@ angular.module('copayApp.controllers').controller('preferencesController',
$scope.encryptChange = function() {
if (!wallet) return;
console.log($scope.encryptEnabled.value);
var val = $scope.encryptEnabled.value;
if (val && !walletService.isEncrypted(wallet)) {
@ -80,7 +77,7 @@ angular.module('copayApp.controllers').controller('preferencesController',
wallet = profileService.getWallet(data.stateParams.walletId);
walletId = wallet.credentials.walletId;
$scope.wallet = wallet;
$scope.externalSource = null;
if (!wallet)
@ -92,6 +89,10 @@ angular.module('copayApp.controllers').controller('preferencesController',
value: $scope.wallet.balanceHidden
};
$scope.encryptEnabled = {
value: walletService.isEncrypted(wallet)
};
$scope.touchIdAvailable = fingerprintService.isAvailable();
$scope.touchIdEnabled = {
value: config.touchIdFor ? config.touchIdFor[walletId] : null