From c15ec586436f8858320e5563fd425b0b65c87186 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 11 Dec 2014 21:26:35 -0300 Subject: [PATCH] rollback --- js/controllers/send.js | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/js/controllers/send.js b/js/controllers/send.js index 82b278b25..d9cfb9b7f 100644 --- a/js/controllers/send.js +++ b/js/controllers/send.js @@ -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