diff --git a/src/js/services/applicationService.js b/src/js/services/applicationService.js index 7a95d636e..c1d80b8a9 100644 --- a/src/js/services/applicationService.js +++ b/src/js/services/applicationService.js @@ -3,6 +3,8 @@ angular.module('copayApp.services') .factory('applicationService', function($rootScope, $timeout, $ionicHistory, $ionicModal, platformInfo, fingerprintService, openURLService, configService, $state) { var root = {}; + root.isPinModalOpen = false; + var isChromeApp = platformInfo.isChromeApp; var isNW = platformInfo.isNW; @@ -34,16 +36,40 @@ angular.module('copayApp.services') }; root.fingerprintModal = function() { - fingerprintService.check('unlockingApp', function(err) { - if (err) { - root.fingerprintModal(); - return; - } + + var scope = $rootScope.$new(true); + $ionicModal.fromTemplateUrl('views/modals/fingerprintCheck.html', { + scope: scope, + animation: 'none', + backdropClickToClose: false, + hardwareBackButtonClose: false + }).then(function(modal) { + scope.fingerprintCheckModal = modal; + scope.openModal(); }); + scope.openModal = function() { + scope.fingerprintCheckModal.show(); + checkFingerprint(); + }; + scope.hideModal = function() { + scope.fingerprintCheckModal.hide(); + }; + + function checkFingerprint() { + fingerprintService.check('unlockingApp', function(err) { + if (err) { + checkFingerprint(); + return; + } + scope.hideModal(); + }); + } }; root.pinModal = function(action) { + if (root.isPinModalOpen) return; + var scope = $rootScope.$new(true); scope.action = action; $ionicModal.fromTemplateUrl('views/modals/pin.html', { @@ -53,6 +79,7 @@ angular.module('copayApp.services') hardwareBackButtonClose: false }).then(function(modal) { scope.pinModal = modal; + root.isPinModalOpen = true; scope.openModal(); }); scope.openModal = function() { @@ -60,6 +87,7 @@ angular.module('copayApp.services') }; scope.hideModal = function() { scope.$emit('pinModalClosed'); + root.isPinModalOpen = false; scope.pinModal.hide(); }; }; diff --git a/www/views/modals/fingerprintCheck.html b/www/views/modals/fingerprintCheck.html new file mode 100644 index 000000000..67996a5f3 --- /dev/null +++ b/www/views/modals/fingerprintCheck.html @@ -0,0 +1,12 @@ + +
+
+
Please enter your FINGERPRINT
+
+
+ +
+
+
+
+