display fingerprint in backup
This commit is contained in:
parent
9ccaf024f7
commit
78e60728f9
2 changed files with 22 additions and 9 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="backup" ng-controller="backupController" ng-init="init()">
|
<div class="backup" ng-controller="backupController" ng-init="init(index.prevState)">
|
||||||
<nav class="tab-bar">
|
<nav class="tab-bar">
|
||||||
<section class="left-small" ng-show="(step != 1 && step != 4)">
|
<section class="left-small" ng-show="(step != 1 && step != 4)">
|
||||||
<a ng-click="goToStep(1);">
|
<a ng-click="goToStep(1);">
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="right-small">
|
<section class="right-small">
|
||||||
<a class="p10" ng-click="backTo(index.prevState)">
|
<a class="p10" ng-click="backTo()">
|
||||||
<span class="text-close">
|
<span class="text-close">
|
||||||
<i class="fi-x size-24"></i>
|
<i class="fi-x size-24"></i>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('backupController',
|
angular.module('copayApp.controllers').controller('backupController',
|
||||||
function($rootScope, $scope, $timeout, $log, go, lodash, profileService, gettext, bwcService, bwsError, walletService, ongoingProcess) {
|
function($rootScope, $scope, $timeout, $log, go, lodash, fingerprintService, platformInfo, configService, profileService, gettext, bwcService, bwsError, walletService, ongoingProcess) {
|
||||||
|
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
|
var prevState;
|
||||||
$scope.customWords = [];
|
$scope.customWords = [];
|
||||||
$scope.walletName = fc.credentials.walletName;
|
$scope.walletName = fc.credentials.walletName;
|
||||||
|
|
||||||
|
|
@ -23,7 +24,8 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
initWords();
|
initWords();
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.init = function() {
|
$scope.init = function(state) {
|
||||||
|
prevState = state;
|
||||||
$scope.passphrase = '';
|
$scope.passphrase = '';
|
||||||
$scope.shuffledMnemonicWords = shuffledWords($scope.mnemonicWords);
|
$scope.shuffledMnemonicWords = shuffledWords($scope.mnemonicWords);
|
||||||
$scope.customWords = [];
|
$scope.customWords = [];
|
||||||
|
|
@ -32,6 +34,20 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
$scope.credentialsEncrypted = false;
|
$scope.credentialsEncrypted = false;
|
||||||
$scope.selectComplete = false;
|
$scope.selectComplete = false;
|
||||||
$scope.backupError = false;
|
$scope.backupError = false;
|
||||||
|
|
||||||
|
if (!platformInfo.isCordova) return;
|
||||||
|
if (isDeletedSeed()) return;
|
||||||
|
|
||||||
|
var config = configService.getSync();
|
||||||
|
var touchidAvailable = fingerprintService.isAvailable();
|
||||||
|
var touchidEnabled = config.touchIdFor ? config.touchIdFor[fc.credentials.walletId] : null;
|
||||||
|
|
||||||
|
if (!touchidAvailable || !touchidEnabled) return;
|
||||||
|
|
||||||
|
fingerprintService.check(fc, function(err) {
|
||||||
|
if (err)
|
||||||
|
go.path(prevState);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function isDeletedSeed() {
|
function isDeletedSeed() {
|
||||||
|
|
@ -40,11 +56,8 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.backTo = function(state) {
|
$scope.backTo = function() {
|
||||||
if (state == 'walletHome')
|
go.path(prevState);
|
||||||
go.walletHome();
|
|
||||||
else
|
|
||||||
go.preferences();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.goToStep = function(n) {
|
$scope.goToStep = function(n) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue