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,
myName: form.myName.$modelValue
}, function(err) {
self.loading = false;
if (err) {
self.loading = false;
self.error = 'Could not join wallet: ' + (err.message ? err.message : err);
$rootScope.$apply();
return
}
else {
go.walletHome();
}
go.walletHome();
});
}, 100);
}

View file

@ -479,15 +479,17 @@ 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) {
if (err)
if (err) {
self.setOngoingProcess();
return self.setError(err);
}
self.resetForm();
});
@ -501,40 +503,37 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.setOngoingProcess('Signing transaction');
fc.signTxProposal(txp, function(err, signedTx) {
profileService.lockFC();
self.setOngoingProcess();
if (err)
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();
return;
}
}
$scope.$emit('Local/TxProposalAction');
txStatus.notify(btx, cb);
txStatus.notify(btx, function() {
self.setOngoingProcess();
return cb();
});
});
} else {
$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) {
var form = $scope.sendForm;
if (to) {