Refactor sell
This commit is contained in:
parent
a5303396c1
commit
4b6be720a7
2 changed files with 4 additions and 6 deletions
|
|
@ -173,13 +173,12 @@ angular.module('copayApp.controllers').controller('sellCoinbaseController', func
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!hasPrimary) $scope.selectedPaymentMethodId.value = $scope.paymentMethods[0].id;
|
if (!hasPrimary) $scope.selectedPaymentMethodId.value = $scope.paymentMethods[0].id;
|
||||||
$scope.sellRequest({ quote: true });
|
$scope.sellRequest();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.sellRequest = function(opts) {
|
$scope.sellRequest = function() {
|
||||||
opts = opts || {};
|
|
||||||
ongoingProcess.set('connectingCoinbase', true);
|
ongoingProcess.set('connectingCoinbase', true);
|
||||||
coinbaseService.init(function(err, res) {
|
coinbaseService.init(function(err, res) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
@ -193,8 +192,7 @@ angular.module('copayApp.controllers').controller('sellCoinbaseController', func
|
||||||
amount: amount,
|
amount: amount,
|
||||||
currency: currency,
|
currency: currency,
|
||||||
payment_method: $scope.selectedPaymentMethodId.value,
|
payment_method: $scope.selectedPaymentMethodId.value,
|
||||||
commit: opts.commit,
|
quote: true
|
||||||
quote: opts.quote
|
|
||||||
};
|
};
|
||||||
coinbaseService.sellRequest(accessToken, accountId, dataSrc, function(err, data) {
|
coinbaseService.sellRequest(accessToken, accountId, dataSrc, function(err, data) {
|
||||||
ongoingProcess.set('connectingCoinbase', false);
|
ongoingProcess.set('connectingCoinbase', false);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
</div>
|
</div>
|
||||||
<select ng-model="selectedPaymentMethodId.value"
|
<select ng-model="selectedPaymentMethodId.value"
|
||||||
ng-options="item.id as item.name for item in paymentMethods"
|
ng-options="item.id as item.name for item in paymentMethods"
|
||||||
ng-change="sellRequest({quote: true})">
|
ng-change="sellRequest()">
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue