Refactor sell

This commit is contained in:
Gustavo Maximiliano Cortez 2017-01-12 23:53:23 -03:00
commit 4b6be720a7
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
2 changed files with 4 additions and 6 deletions

View file

@ -173,13 +173,12 @@ angular.module('copayApp.controllers').controller('sellCoinbaseController', func
return;
}
if (!hasPrimary) $scope.selectedPaymentMethodId.value = $scope.paymentMethods[0].id;
$scope.sellRequest({ quote: true });
$scope.sellRequest();
});
});
});
$scope.sellRequest = function(opts) {
opts = opts || {};
$scope.sellRequest = function() {
ongoingProcess.set('connectingCoinbase', true);
coinbaseService.init(function(err, res) {
if (err) {
@ -193,8 +192,7 @@ angular.module('copayApp.controllers').controller('sellCoinbaseController', func
amount: amount,
currency: currency,
payment_method: $scope.selectedPaymentMethodId.value,
commit: opts.commit,
quote: opts.quote
quote: true
};
coinbaseService.sellRequest(accessToken, accountId, dataSrc, function(err, data) {
ongoingProcess.set('connectingCoinbase', false);

View file

@ -17,7 +17,7 @@
</div>
<select ng-model="selectedPaymentMethodId.value"
ng-options="item.id as item.name for item in paymentMethods"
ng-change="sellRequest({quote: true})">
ng-change="sellRequest()">
</select>
</label>