Disable Sendform when sending a transaction

This commit is contained in:
Gustavo Maximiliano Cortez 2015-02-13 16:34:12 -03:00
commit 575e99b490
2 changed files with 28 additions and 45 deletions

View file

@ -183,35 +183,33 @@ angular.module('copayApp.controllers').controller('SendController',
}
$scope.loading = true;
$scope.creatingTX = true;
if ($scope.isWindowsPhoneApp)
$rootScope.wpInputFocused = true;
$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));
}
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;
$scope.creatingTX = false;
if ($scope.isWindowsPhoneApp)
$rootScope.wpInputFocused = false;
w.spend({
merchantData: merchantData,
toAddress: address,
amountSat: amount,
comment: comment,
}, function (err, txid, status) {
$scope.loading = false;
if ($scope.isWindowsPhoneApp)
$rootScope.wpInputFocused = false;
if (err)
return $scope.setError(err);
txStatus.notify(status);
$scope.resetForm();
});
if (err)
return $scope.setError(err);
txStatus.notify(status);
$scope.resetForm();
});
}, 100);
};