set lock/unlock properly

This commit is contained in:
JDonadio 2017-03-02 16:32:08 -03:00
commit e5ecc111f3
5 changed files with 54 additions and 51 deletions

View file

@ -3,10 +3,10 @@
angular.module('copayApp.services').factory('pincodeService', function($log, $rootScope, $ionicModal, configService) {
var root = {};
var openPincodeModal = function(opts) {
root.lockChange = function(opts) {
var scope = $rootScope.$new(true);
scope.from = opts.from;
scope.enabled = opts.enabled;
scope.locking = opts.locking;
$ionicModal.fromTemplateUrl('views/modals/pincode.html', {
scope: scope,
backdropClickToClose: false,
@ -17,12 +17,6 @@ angular.module('copayApp.services').factory('pincodeService', function($log, $ro
});
};
root.lockChange = function(opts) {
if (opts.enabled) console.log('Locking app from service');
else console.log('Unlocking app from service');
openPincodeModal(opts);
};
root.isLocked = function() {
var config = configService.getSync();
return config.pincode ? config.pincode.enabled : false;