adding modal to fingerprint check
This commit is contained in:
parent
709b0369f1
commit
d67391dedf
2 changed files with 45 additions and 5 deletions
|
|
@ -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();
|
||||
};
|
||||
};
|
||||
|
|
|
|||
12
www/views/modals/fingerprintCheck.html
Normal file
12
www/views/modals/fingerprintCheck.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<ion-modal-view id="pin">
|
||||
<div class="content">
|
||||
<div class="block-text row">
|
||||
<div class="message" translate>Please enter your FINGERPRINT</div>
|
||||
</div>
|
||||
<div class="app-icon">
|
||||
<i class="icon big-icon-svg">
|
||||
<div class="bg"></div>
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
</ion-modal-view>
|
||||
Loading…
Add table
Add a link
Reference in a new issue