display fingerprint in export wallet
This commit is contained in:
parent
0f343a8974
commit
9ccaf024f7
2 changed files with 27 additions and 11 deletions
|
|
@ -4,12 +4,13 @@
|
|||
ng-init="titleSection='Export Wallet'; goBackToState = 'preferencesAdvanced'">
|
||||
</div>
|
||||
|
||||
<div class="content preferences" ng-controller="exportController">
|
||||
<div class="content preferences" ng-controller="exportController" ng-init="init()">
|
||||
<h4></h4>
|
||||
<div ng-show="!backupWalletPlainText">
|
||||
<div class="text-warning size-14 m20b" ng-show="error">
|
||||
<i class="fi-alert size-12"></i>
|
||||
<span translate> Failed to export </span>
|
||||
<span ng-show="!touchIdError" translate>Failed to export</span>
|
||||
<span ng-show="touchIdError">{{touchIdError}}</span>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
|
|
|||
|
|
@ -1,15 +1,30 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('exportController',
|
||||
function($rootScope, $scope, $timeout, $log, backupService, storageService, profileService, platformInfo, notification, go, gettext, gettextCatalog) {
|
||||
function($rootScope, $scope, $timeout, $log, backupService, fingerprintService, configService, storageService, profileService, platformInfo, notification, go, gettext, gettextCatalog) {
|
||||
var isWP = platformInfo.isWP;
|
||||
var isAndroid = platformInfo.isAndroid;
|
||||
|
||||
$scope.error = null;
|
||||
$scope.success = null;
|
||||
$scope.metaDataEnabled = true;
|
||||
var isCordova = platformInfo.isCordova;
|
||||
var fc = profileService.focusedClient;
|
||||
$scope.isEncrypted = fc.isPrivKeyEncrypted();
|
||||
$scope.touchIdError = null;
|
||||
$scope.error = null;
|
||||
$scope.success = null;
|
||||
|
||||
$scope.init = function() {
|
||||
if (!isCordova) 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($scope.goBackToState);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.downloadWalletBackup = function() {
|
||||
$scope.getMetaData($scope.metaDataEnabled, function(err, txsFromLocal, localAddressBook) {
|
||||
|
|
@ -46,7 +61,7 @@ angular.module('copayApp.controllers').controller('exportController',
|
|||
return cb(null, txsFromLocal, localAddressBook)
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.getHistoryCache = function(cb) {
|
||||
storageService.getTxHistory(fc.credentials.walletId, function(err, txs) {
|
||||
|
|
@ -63,7 +78,7 @@ angular.module('copayApp.controllers').controller('exportController',
|
|||
|
||||
return cb(null, localTxs);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.getAddressbook = function(cb) {
|
||||
storageService.getAddressbook(fc.credentials.network, function(err, addressBook) {
|
||||
|
|
@ -78,7 +93,7 @@ angular.module('copayApp.controllers').controller('exportController',
|
|||
|
||||
return cb(null, localAddressBook);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.getBackup = function(cb) {
|
||||
$scope.getMetaData($scope.metaDataEnabled, function(err, txsFromLocal, localAddressBook) {
|
||||
|
|
@ -101,7 +116,7 @@ angular.module('copayApp.controllers').controller('exportController',
|
|||
}
|
||||
return cb(ew);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.viewWalletBackup = function() {
|
||||
$timeout(function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue