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

View File

@ -145,29 +145,26 @@ 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));
}
$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)
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