Fix setting touchId
This commit is contained in:
parent
086413ba59
commit
b38e2f6ef3
2 changed files with 15 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesController',
|
||||
function($scope, $rootScope, $timeout, $log, configService, profileService) {
|
||||
function($scope, $rootScope, $timeout, $log, configService, profileService, txSignService) {
|
||||
|
||||
var fc = profileService.focusedClient;
|
||||
$scope.deleted = false;
|
||||
|
|
@ -75,7 +75,7 @@ angular.module('copayApp.controllers').controller('preferencesController',
|
|||
};
|
||||
opts.touchIdFor[walletId] = newVal;
|
||||
|
||||
$rootScope.$emit('Local/RequestTouchid', function(err) {
|
||||
txSignService.setTouchId(function(err) {
|
||||
if (err) {
|
||||
$log.debug(err);
|
||||
$timeout(function() {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
angular.module('copayApp.services').factory('txSignService', function($rootScope, profileService, gettextCatalog, lodash, trezor, ledger, configService, bwsError, $log) {
|
||||
var root = {};
|
||||
var config = configService.getSync();
|
||||
|
||||
var reportSigningStatus = function(opts) {
|
||||
if (!opts.reporterFn) return;
|
||||
|
|
@ -41,17 +40,26 @@ angular.module('copayApp.services').factory('txSignService', function($rootScope
|
|||
return cb();
|
||||
},
|
||||
function(msg) {
|
||||
$log.debug('Touch ID Failed:' + msg);
|
||||
return cb(gettext('Touch ID Failed:') + msg);
|
||||
$log.debug('Touch ID Failed:' + JSON.stringify(msg));
|
||||
return cb(gettextCatalog.getString('Touch ID Failed') + ': ' + msg.localizedDescription);
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
$log.debug('Touch ID Failed:' + e);
|
||||
return cb(gettext('Touch ID Failed:') + e);
|
||||
$log.debug('Touch ID Failed:' + JSON.stringify(e));
|
||||
return cb(gettextCatalog.getString('Touch ID Failed'));
|
||||
};
|
||||
};
|
||||
|
||||
root.setTouchId = function(cb) {
|
||||
if (window.touchidAvailable) {
|
||||
requestTouchId(cb);
|
||||
} else {
|
||||
return cb();
|
||||
}
|
||||
};
|
||||
|
||||
root.checkTouchId = function(cb) {
|
||||
var config = configService.getSync();
|
||||
var fc = profileService.focusedClient;
|
||||
config.touchIdFor = config.touchIdFor || {};
|
||||
if (window.touchidAvailable && config.touchIdFor[fc.credentials.walletId]) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue