Enter Amount displaying ongoing progress indicator when contacting Shapeshift. Send max button now displays max limit amount when available funds are above the Shapeshift limit.

This commit is contained in:
Brendon Duncan 2018-09-04 12:21:57 +12:00
commit 4dc3e7c2e8
2 changed files with 7 additions and 6 deletions

View file

@ -2,7 +2,7 @@
angular.module('copayApp.controllers').controller('amountController', amountController);
function amountController(configService, $filter, gettextCatalog, $ionicHistory, $ionicModal, $ionicScrollDelegate, lodash, $log, nodeWebkitService, rateService, $scope, $state, $timeout, sendFlowService, shapeshiftService, txFormatService, platformInfo, profileService, walletService, $window) {
function amountController(configService, $filter, gettextCatalog, $ionicHistory, $ionicModal, $ionicScrollDelegate, lodash, $log, nodeWebkitService, rateService, $scope, $state, $timeout, sendFlowService, shapeshiftService, txFormatService, platformInfo, ongoingProcess, profileService, walletService, $window) {
var vm = this;
vm.allowSend = false;
@ -231,8 +231,9 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
vm.showSendLimitMaxButton = false;
vm.canSendAllAvailableFunds = false;
shapeshiftService.getMarketData(vm.fromWallet.coin, vm.toWallet.coin, function(data) {
ongoingProcess.set('connectingShapeshift', true);
shapeshiftService.getMarketData(vm.fromWallet.coin, vm.toWallet.coin, function onMarketData(data) {
ongoingProcess.set('connectingShapeshift', false);
vm.thirdParty.data['minAmount'] = vm.minAmount = parseFloat(data.minimum);
vm.thirdParty.data['maxAmount'] = vm.maxAmount = parseFloat(data.maxLimit);

View file

@ -53,11 +53,11 @@
</div>
<div class="keypad-container" style="background: #fff; position: absolute; bottom: 0; margin-bottom: 57px; width: 100%;">
<div class="sendmax" ng-if="vm.showSendMaxButton || vm.showSendMaxLimitButton">
<div class="sendmax" ng-if="vm.showSendMaxButton || vm.showSendLimitMaxButton">
<button class="button button-sendmax" ng-click="vm.sendMax()">
<span>
<span ng-if="vm.showSendMaxButton" translate>Use All Available Funds</span>
<span ng-if="vm.showSendMaxLimitButton" translate>Send Maximum Amount</span>&ensp;
<span ng-if="vm.showSendLimitMaxButton" translate>Send Maximum Amount</span>&ensp;
<span class="available-funds-amount">(<formatted-amount value="{{vm.sendableFunds}}"></formatted-amount>)</span>
</span>
</button>