check if fingerprint modal is open

This commit is contained in:
Gabriel Bazán 2017-05-09 18:39:09 -03:00
commit c924e1116b

View file

@ -45,6 +45,7 @@ angular.module('copayApp.services')
hardwareBackButtonClose: false hardwareBackButtonClose: false
}).then(function(modal) { }).then(function(modal) {
scope.fingerprintCheckModal = modal; scope.fingerprintCheckModal = modal;
root.isModalOpen = true;
scope.openModal(); scope.openModal();
}); });
scope.openModal = function() { scope.openModal = function() {
@ -52,6 +53,7 @@ angular.module('copayApp.services')
checkFingerprint(); checkFingerprint();
}; };
scope.hideModal = function() { scope.hideModal = function() {
root.isModalOpen = false;
scope.fingerprintCheckModal.hide(); scope.fingerprintCheckModal.hide();
}; };
@ -68,8 +70,6 @@ angular.module('copayApp.services')
root.pinModal = function(action) { root.pinModal = function(action) {
if (root.isPinModalOpen) return;
var scope = $rootScope.$new(true); var scope = $rootScope.$new(true);
scope.action = action; scope.action = action;
$ionicModal.fromTemplateUrl('views/modals/pin.html', { $ionicModal.fromTemplateUrl('views/modals/pin.html', {
@ -79,7 +79,7 @@ angular.module('copayApp.services')
hardwareBackButtonClose: false hardwareBackButtonClose: false
}).then(function(modal) { }).then(function(modal) {
scope.pinModal = modal; scope.pinModal = modal;
root.isPinModalOpen = true; root.isModalOpen = true;
scope.openModal(); scope.openModal();
}); });
scope.openModal = function() { scope.openModal = function() {
@ -87,13 +87,15 @@ angular.module('copayApp.services')
}; };
scope.hideModal = function() { scope.hideModal = function() {
scope.$emit('pinModalClosed'); scope.$emit('pinModalClosed');
root.isPinModalOpen = false; root.isModalOpen = false;
scope.pinModal.hide(); scope.pinModal.hide();
}; };
}; };
root.appLockModal = function(action) { root.appLockModal = function(action) {
if (root.isModalOpen) return;
configService.whenAvailable(function(config) { configService.whenAvailable(function(config) {
var lockMethod = config.lock && config.lock.method; var lockMethod = config.lock && config.lock.method;
if (!lockMethod || lockMethod == 'none') return; if (!lockMethod || lockMethod == 'none') return;