fix config.lock options by default

This commit is contained in:
JDonadio 2017-04-18 10:18:55 -03:00
commit ef0addc29d
2 changed files with 10 additions and 8 deletions

View file

@ -15,6 +15,7 @@ angular.module('copayApp.controllers').controller('pinController', function($sta
$scope.$on("$ionicView.enter", function(event) {
configService.whenAvailable(function(config) {
if (!config.lock) return;
$scope.bannedUntil = config.lock.bannedUntil || null;
if ($scope.bannedUntil) {
var now = Math.floor(Date.now() / 1000);
@ -156,12 +157,13 @@ angular.module('copayApp.controllers').controller('pinController', function($sta
function saveSettings(method, value) {
var config = configService.getSync();
var attempts = config.lock && config.lock.attempts ? config.lock.attempts : 0;
var opts = {
lock: {
method: method || '',
value: value || '',
bannedUntil: null,
attempts: config.lock.attempts + 1,
attempts: attempts + 1,
}
};