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 FINGERPRINT = 'fingerprint';
$scope.$on("$ionicView.beforeEnter", function(event) {
function init() {
var config = configService.getSync();
$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');
processWallets();
};
$scope.$on("$ionicView.beforeEnter", function(event) {
init();
});
function processWallets() {
@ -77,6 +81,7 @@ angular.module('copayApp.controllers').controller('lockController', function($st
if (config.lock.method == PIN) {
askForDisablePin(function(disablePin) {
if (disablePin) saveConfig(FINGERPRINT);
else init();
});
} else saveConfig(FINGERPRINT);
} else if (method == PIN) {

View file

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