Skip to content

Commit 6ac0403

Browse files
request touch id after resolving usernames
1 parent 9d141f0 commit 6ac0403

File tree

1 file changed

+62
-62
lines changed

1 file changed

+62
-62
lines changed

src/js/controllers/walletHome.js

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -919,82 +919,82 @@ angular.module('copayApp.controllers')
919919
indexScope.setOngoingProcess(gettext('sending'), true);
920920
$timeout(function() {
921921

922-
profileService.requestTouchid(function(err) {
923-
if (err) {
924-
profileService.lockFC();
925-
indexScope.setOngoingProcess(gettext('sending'), false);
926-
self.error = err;
927-
$timeout(function() {
928-
delete self.current_payment_key;
929-
$scope.$digest();
930-
}, 1);
931-
return;
932-
}
933-
934-
if (!isMultipleSend && accountValidationResult.isValid) { // try to replace validation result with attested BB address
935-
var attestorKey = accountValidationResult.attestorKey;
936-
var account = accountValidationResult.account;
937-
var bb_address = aliasValidationService.getBbAddress(
922+
if (!isMultipleSend && accountValidationResult.isValid) { // try to replace validation result with attested BB address
923+
var attestorKey = accountValidationResult.attestorKey;
924+
var account = accountValidationResult.account;
925+
var bb_address = aliasValidationService.getBbAddress(
926+
attestorKey,
927+
account
928+
);
929+
console.log('attestorKey='+attestorKey+' : account='+account+' : bb_address='+bb_address);
930+
931+
if (!bb_address) {
932+
return aliasValidationService.resolveValueToBbAddress(
938933
attestorKey,
939-
account
940-
);
941-
console.log('attestorKey='+attestorKey+' : account='+account+' : bb_address='+bb_address);
942-
943-
if (!bb_address) {
944-
return aliasValidationService.resolveValueToBbAddress(
945-
attestorKey,
946-
account,
947-
function () {
948-
// assocBbAddresses in aliasValidationService is now filled
949-
delete self.current_payment_key;
950-
self.submitPayment();
951-
}
952-
);
953-
}
954-
955-
if (!isEmail) {
956-
957-
if (bb_address === 'unknown' || bb_address === 'none') {
958-
if (bb_address === 'unknown') {
959-
aliasValidationService.deleteAssocBbAddress(
960-
attestorKey,
961-
account
962-
);
963-
}
964-
934+
account,
935+
function () {
936+
// assocBbAddresses in aliasValidationService is now filled
965937
delete self.current_payment_key;
966-
indexScope.setOngoingProcess(gettext('sending'), false);
967-
return self.setSendError('Attested account not found');
968-
} else if (ValidationUtils.isValidAddress(bb_address)) {
969-
original_address = address;
970-
address = bb_address;
971-
isEmail = false;
972-
isTextcoin = false;
973-
} else {
974-
throw Error("unrecognized bb_address: "+bb_address);
938+
self.submitPayment();
975939
}
940+
);
941+
}
976942

977-
} else {
943+
if (!isEmail) {
978944

945+
if (bb_address === 'unknown' || bb_address === 'none') {
979946
if (bb_address === 'unknown') {
980947
aliasValidationService.deleteAssocBbAddress(
981948
attestorKey,
982949
account
983-
); // send textcoin now but retry next time
984-
} else if (bb_address === 'none') {
985-
// go on to send textcoin
986-
} else if (ValidationUtils.isValidAddress(bb_address)) {
987-
original_address = account;
988-
address = bb_address;
989-
isEmail = false;
990-
isTextcoin = false;
991-
} else {
992-
throw Error("unrecognized bb_address: "+bb_address);
950+
);
993951
}
994952

953+
delete self.current_payment_key;
954+
indexScope.setOngoingProcess(gettext('sending'), false);
955+
return self.setSendError('Attested account not found');
956+
} else if (ValidationUtils.isValidAddress(bb_address)) {
957+
original_address = address;
958+
address = bb_address;
959+
isEmail = false;
960+
isTextcoin = false;
961+
} else {
962+
throw Error("unrecognized bb_address: "+bb_address);
963+
}
964+
965+
} else {
966+
967+
if (bb_address === 'unknown') {
968+
aliasValidationService.deleteAssocBbAddress(
969+
attestorKey,
970+
account
971+
); // send textcoin now but retry next time
972+
} else if (bb_address === 'none') {
973+
// go on to send textcoin
974+
} else if (ValidationUtils.isValidAddress(bb_address)) {
975+
original_address = account;
976+
address = bb_address;
977+
isEmail = false;
978+
isTextcoin = false;
979+
} else {
980+
throw Error("unrecognized bb_address: "+bb_address);
995981
}
982+
996983
}
984+
}
997985

986+
profileService.requestTouchid(function(err) {
987+
if (err) {
988+
profileService.lockFC();
989+
indexScope.setOngoingProcess(gettext('sending'), false);
990+
self.error = err;
991+
$timeout(function() {
992+
delete self.current_payment_key;
993+
$scope.$digest();
994+
}, 1);
995+
return;
996+
}
997+
998998
var device = require('byteballcore/device.js');
999999
if (self.binding) {
10001000
if (isTextcoin) {

0 commit comments

Comments
 (0)