From 4dc3e7c2e83202080d8762f3ff22834e6bed3858 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 4 Sep 2018 12:21:57 +1200 Subject: [PATCH] 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. --- src/js/controllers/amount.js | 9 +++++---- www/views/amount.html | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 05c4b9d8b..ff4ec3628 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -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); @@ -740,7 +741,7 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory, console.log('sendmax Setting max button text'); transactionSendableAmount.crypto = txFormatService.formatAmountStr(wallet.coin, transactionSendableAmount.satoshis); vm.sendableFunds = transactionSendableAmount.crypto; - + if (availableUnits[unitIndex].isFiat) { txFormatService.formatAlternativeStr(wallet.coin, transactionSendableAmount.satoshis, function onFormat(formatted){ if (formatted) { diff --git a/www/views/amount.html b/www/views/amount.html index 114292026..51397f3bf 100644 --- a/www/views/amount.html +++ b/www/views/amount.html @@ -53,11 +53,11 @@
-
+