display fingerprint in backup

This commit is contained in:
Javier 2016-06-16 13:53:44 -03:00
commit 78e60728f9
2 changed files with 22 additions and 9 deletions

View file

@ -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">
<section class="left-small" ng-show="(step != 1 && step != 4)">
<a ng-click="goToStep(1);">
@ -11,7 +11,7 @@
</section>
<section class="right-small">
<a class="p10" ng-click="backTo(index.prevState)">
<a class="p10" ng-click="backTo()">
<span class="text-close">
<i class="fi-x size-24"></i>
</span>

View file

@ -1,9 +1,10 @@
'use strict';
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 prevState;
$scope.customWords = [];
$scope.walletName = fc.credentials.walletName;
@ -23,7 +24,8 @@ angular.module('copayApp.controllers').controller('backupController',
initWords();
}
$scope.init = function() {
$scope.init = function(state) {
prevState = state;
$scope.passphrase = '';
$scope.shuffledMnemonicWords = shuffledWords($scope.mnemonicWords);
$scope.customWords = [];
@ -32,6 +34,20 @@ angular.module('copayApp.controllers').controller('backupController',
$scope.credentialsEncrypted = false;
$scope.selectComplete = 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() {
@ -40,11 +56,8 @@ angular.module('copayApp.controllers').controller('backupController',
return false;
};
$scope.backTo = function(state) {
if (state == 'walletHome')
go.walletHome();
else
go.preferences();
$scope.backTo = function() {
go.path(prevState);
};
$scope.goToStep = function(n) {