refresh selected option

This commit is contained in:
JDonadio 2017-04-04 16:47:36 -03:00
commit 5b1c84b5f7
2 changed files with 8 additions and 3 deletions

View file

@ -5,7 +5,7 @@ angular.module('copayApp.controllers').controller('lockController', function($st
var PIN = 'pin'; var PIN = 'pin';
var FINGERPRINT = 'fingerprint'; var FINGERPRINT = 'fingerprint';
$scope.$on("$ionicView.beforeEnter", function(event) { function init() {
var config = configService.getSync(); var config = configService.getSync();
$scope.locking = config.lock.method != PIN; $scope.locking = config.lock.method != PIN;
@ -34,6 +34,10 @@ angular.module('copayApp.controllers').controller('lockController', function($st
$scope.currentOption = lodash.find($scope.options, 'value'); $scope.currentOption = lodash.find($scope.options, 'value');
processWallets(); processWallets();
};
$scope.$on("$ionicView.beforeEnter", function(event) {
init();
}); });
function processWallets() { function processWallets() {
@ -77,6 +81,7 @@ angular.module('copayApp.controllers').controller('lockController', function($st
if (config.lock.method == PIN) { if (config.lock.method == PIN) {
askForDisablePin(function(disablePin) { askForDisablePin(function(disablePin) {
if (disablePin) saveConfig(FINGERPRINT); if (disablePin) saveConfig(FINGERPRINT);
else init();
}); });
} else saveConfig(FINGERPRINT); } else saveConfig(FINGERPRINT);
} else if (method == PIN) { } else if (method == PIN) {

View file

@ -54,8 +54,8 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
$scope.isDevel = platformInfo.isDevel; $scope.isDevel = platformInfo.isDevel;
$scope.appName = appConfigService.nameCase; $scope.appName = appConfigService.nameCase;
configService.whenAvailable(function(config) { configService.whenAvailable(function(config) {
$scope.locked = config.lock.method == 'fingerprint' || config.lock.value || false; $scope.locked = config.lock && config.lock.method != '' ? true : false;
$scope.method = config.lock.method != '' ? config.lock.method.charAt(0).toUpperCase() + config.lock.method.slice(1) : gettextCatalog.getString('Disabled'); $scope.method = config.lock && config.lock.method != '' ? config.lock.method.charAt(0).toUpperCase() + config.lock.method.slice(1) : gettextCatalog.getString('Disabled');
}); });
}); });