loading after click on send button

This commit is contained in:
Gustavo Maximiliano Cortez 2014-12-11 21:17:49 -03:00
parent 02e228ffe7
commit 7340b4af29
1 changed files with 19 additions and 16 deletions

View File

@ -145,26 +145,29 @@ angular.module('copayApp.controllers').controller('SendController',
}
$scope.loading = true;
var comment = form.comment.$modelValue;
var merchantData = $scope._merchantData;
var address, amount;
if (!merchantData) {
address = form.address.$modelValue;
amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0));
}
w.spend({
merchantData: merchantData,
toAddress: address,
amountSat: amount,
comment: comment,
}, function(err, txid, status) {
$scope.loading = false;
if (err)
$timeout(function() {
var comment = form.comment.$modelValue;
var merchantData = $scope._merchantData;
var address, amount;
if (!merchantData) {
address = form.address.$modelValue;
amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0));
}
w.spend({
merchantData: merchantData,
toAddress: address,
amountSat: amount,
comment: comment,
}, function(err, txid, status) {
$scope.loading = false;
if (err)
return $scope.setError(err);
txStatus.notify(status);
$scope.resetForm();
});
});
}, 100);
};
// QR code Scanner