Merge pull request #2640 from matiu/feat/modal2

Feat/modal2
This commit is contained in:
Gustavo Maximiliano Cortez 2015-04-27 10:12:45 -03:00
commit 6bd35493de
9 changed files with 67 additions and 64 deletions

View file

@ -486,17 +486,18 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
message: comment,
payProUrl: paypro ? paypro.url : null,
}, function(err, txp) {
self.setOngoingProcess();
if (err) {
self.setOngoingProcess();
profileService.lockFC();
return self.setError(err);
}
self.signAndBroadcast(txp, function(err) {
profileService.lockFC();
if (err) {
self.setOngoingProcess();
return self.setError(err);
}
self.resetForm();
});
});
@ -509,43 +510,37 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.setOngoingProcess('Signing transaction');
fc.signTxProposal(txp, function(err, signedTx) {
profileService.lockFC();
self.setOngoingProcess();
if (err) {
self.setOngoingProcess();
return cb(err);
}
if (signedTx.status == 'accepted') {
self.setOngoingProcess('Broadcasting transaction');
fc.broadcastTxProposal(signedTx, function(err, btx) {
self.setOngoingProcess();
if (err) {
self.setOngoingProcess();
$scope.error = 'Transaction not broadcasted. Please try again.';
$scope.$digest();
} else {
txStatus.notify(btx);
$scope.$emit('Local/TxProposalAction');
return;
}
return cb();
$scope.$emit('Local/TxProposalAction');
txStatus.notify(btx, function() {
self.setOngoingProcess();
return cb();
});
});
} else {
txStatus.notify(signedTx);
$scope.$emit('Local/TxProposalAction');
return cb();
txStatus.notify(signedTx, function() {
self.setOngoingProcess();
return cb();
});
}
});
};
this.setTopAmount = function() {
throw new Error('todo: setTopAmount');
var form = $scope.sendForm;
if (form) {
form.amount.$setViewValue(w.balanceInfo.topAmount);
form.amount.$render();
form.amount.$isValid = true;
}
};
this.setForm = function(to, amount, comment) {
var form = $scope.sendForm;
if (to) {