fix timming / display issues

This commit is contained in:
Matias Alejo Garcia 2015-04-27 02:38:48 -03:00
commit 405e4cc75c
2 changed files with 20 additions and 22 deletions

View file

@ -145,14 +145,13 @@ angular.module('copayApp.controllers').controller('joinController',
extendedPrivateKey: form.privateKey.$modelValue, extendedPrivateKey: form.privateKey.$modelValue,
myName: form.myName.$modelValue myName: form.myName.$modelValue
}, function(err) { }, function(err) {
self.loading = false;
if (err) { if (err) {
self.loading = false;
self.error = 'Could not join wallet: ' + (err.message ? err.message : err); self.error = 'Could not join wallet: ' + (err.message ? err.message : err);
$rootScope.$apply(); $rootScope.$apply();
return
} }
else { go.walletHome();
go.walletHome();
}
}); });
}, 100); }, 100);
} }

View file

@ -479,15 +479,17 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
message: comment, message: comment,
payProUrl: paypro ? paypro.url : null, payProUrl: paypro ? paypro.url : null,
}, function(err, txp) { }, function(err, txp) {
self.setOngoingProcess();
if (err) { if (err) {
self.setOngoingProcess();
profileService.lockFC(); profileService.lockFC();
return self.setError(err); return self.setError(err);
} }
self.signAndBroadcast(txp, function(err) { self.signAndBroadcast(txp, function(err) {
if (err) if (err) {
self.setOngoingProcess();
return self.setError(err); return self.setError(err);
}
self.resetForm(); self.resetForm();
}); });
@ -501,40 +503,37 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.setOngoingProcess('Signing transaction'); self.setOngoingProcess('Signing transaction');
fc.signTxProposal(txp, function(err, signedTx) { fc.signTxProposal(txp, function(err, signedTx) {
profileService.lockFC(); profileService.lockFC();
self.setOngoingProcess();
if (err) if (err) {
self.setOngoingProcess();
return cb(err); return cb(err);
}
if (signedTx.status == 'accepted') { if (signedTx.status == 'accepted') {
self.setOngoingProcess('Broadcasting transaction'); self.setOngoingProcess('Broadcasting transaction');
fc.broadcastTxProposal(signedTx, function(err, btx) { fc.broadcastTxProposal(signedTx, function(err, btx) {
self.setOngoingProcess();
if (err) { if (err) {
self.setOngoingProcess();
$scope.error = 'Transaction not broadcasted. Please try again.'; $scope.error = 'Transaction not broadcasted. Please try again.';
$scope.$digest(); $scope.$digest();
return; return;
} }
$scope.$emit('Local/TxProposalAction'); $scope.$emit('Local/TxProposalAction');
txStatus.notify(btx, cb); txStatus.notify(btx, function() {
self.setOngoingProcess();
return cb();
});
}); });
} else { } else {
$scope.$emit('Local/TxProposalAction'); $scope.$emit('Local/TxProposalAction');
txStatus.notify(signedTx, 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) { this.setForm = function(to, amount, comment) {
var form = $scope.sendForm; var form = $scope.sendForm;
if (to) { if (to) {