Fix duplicate request of password or touchid

This commit is contained in:
Gustavo Maximiliano Cortez 2016-02-25 10:41:04 -03:00
commit 72ac721642
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF

View file

@ -944,35 +944,29 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.setOngoingProcess();
self.setSendError(err);
} else {
self.prepareSignAndBroadcastTx(txpPublished);
txService.signAndBroadcast(txpPublished, {
reporterFn: self.setOngoingProcess.bind(self)
}, function(err, txp) {
self.resetForm();
if (err) {
self.error = err.message ? err.message : gettext('The payment was created but could not be completed. Please try again from home screen');
$scope.$emit('Local/TxProposalAction');
$timeout(function() {
$scope.$digest();
}, 1);
} else {
go.walletHome();
txStatus.notify(txp, function() {
$scope.$emit('Local/TxProposalAction', txp.status == 'broadcasted');
});
}
});
}
});
});
};
this.prepareSignAndBroadcastTx = function(txp) {
var fc = profileService.focusedClient;
var self = this;
txService.prepareAndSignAndBroadcast(txp, {
reporterFn: self.setOngoingProcess.bind(self)
}, function(err, txp) {
self.resetForm();
if (err) {
self.error = err.message ? err.message : gettext('The payment was created but could not be completed. Please try again from home screen');
$scope.$emit('Local/TxProposalAction');
$timeout(function() {
$scope.$digest();
}, 1);
} else {
go.walletHome();
txStatus.notify(txp, function() {
$scope.$emit('Local/TxProposalAction', txp.status == 'broadcasted');
});
}
});
};
this.setForm = function(to, amount, comment) {
var form = $scope.sendForm;
if (to) {