diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index ff3e8beb9..51a42904d 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -19,8 +19,6 @@ angular.module('copayApp.controllers').controller('amountController', function($ // Glidera parameters $scope.isGlidera = data.stateParams.isGlidera; $scope.glideraAccessToken = data.stateParams.glideraAccessToken; - $scope.glideraBuy = data.stateParams.glideraBuy; - $scope.glideraSell = data.stateParams.glideraSell; $scope.cardId = data.stateParams.cardId; $scope.showMenu = $ionicHistory.backView().stateName == 'tabs.send'; @@ -343,8 +341,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ var amount = $scope.showAlternativeAmount ? fromFiat(_amount) : _amount; $state.transitionTo('tabs.buyandsell.glidera.confirm', { toAmount: (amount * unitToSatoshi).toFixed(0), - glideraBuy: $scope.glideraBuy, - glideraSell: $scope.glideraSell, + isGlidera: $scope.isGlidera, glideraAccessToken: $scope.glideraAccessToken }); } else { diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index fa55c6592..6872e4e87 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -24,8 +24,6 @@ angular.module('copayApp.controllers').controller('confirmController', function( // Glidera parameters $scope.isGlidera = data.stateParams.isGlidera; $scope.glideraAccessToken = data.stateParams.glideraAccessToken; - $scope.glideraBuy = data.stateParams.glideraBuy; - $scope.glideraSell = data.stateParams.glideraSell; toAmount = data.stateParams.toAmount; cachedSendMax = {}; @@ -132,8 +130,8 @@ angular.module('copayApp.controllers').controller('confirmController', function( txFormatService.formatAlternativeStr(toAmount, function(v) { $scope.alternativeAmountStr = v; }); - if ($scope.isGlidera && $scope.glideraBuy) $scope.getBuyPrice(); - if ($scope.isGlidera && $scope.glideraSell) $scope.getSellPrice(); + if ($scope.isGlidera == 'buy') $scope.getBuyPrice(); + if ($scope.isGlidera == 'sell') $scope.getSellPrice(); }; function resetValues() { @@ -242,7 +240,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( }); $scope.showWalletSelector = function() { - $scope.walletSelectorTitle = $scope.glideraBuy ? 'Receive in' : $scope.glideraSell ? 'Sell From' : 'Send from'; + $scope.walletSelectorTitle = $scope.isGlidera == 'buy' ? 'Receive in' : $scope.isGlidera == 'sell' ? 'Sell From' : 'Send from'; if (!$scope.useSendMax && ($scope.insufficientFunds || $scope.noMatchingWallet)) return; $scope.showWallets = true; }; diff --git a/src/js/routes.js b/src/js/routes.js index 78b339714..278d24646 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -889,27 +889,21 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }) .state('tabs.buyandsell.glidera.amount', { - url: '/amount/:glideraBuy/:glideraSell/:glideraAccessToken', + url: '/amount/:isGlidera/:glideraAccessToken', views: { 'tab-home@tabs': { controller: 'amountController', templateUrl: 'views/amount.html' } - }, - params: { - isGlidera: true } }) .state('tabs.buyandsell.glidera.confirm', { - url: '/confirm/:toAmount/:glideraBuy/:glideraSell/:glideraAccessToken', + url: '/confirm/:toAmount/:isGlidera/:glideraAccessToken', views: { 'tab-home@tabs': { controller: 'confirmController', templateUrl: 'views/confirm.html' } - }, - params: { - isGlidera: true } }) .state('tabs.preferences.glidera', { diff --git a/www/views/amount.html b/www/views/amount.html index aab0fb4f8..c2d36dc12 100644 --- a/www/views/amount.html +++ b/www/views/amount.html @@ -43,7 +43,7 @@ Amount (Purchase Amount is limited to USD 500 per day)
-
+
Daily buy limit: {{limits.dailyBuy|currency:'':2}} {{limits.currency}} (remaining {{limits.dailyBuyRemaining|currency:'':2}} {{limits.currency}}) @@ -52,7 +52,7 @@ {{limits.monthlyBuy|currency:'':2}} {{limits.currency}} (remaining {{limits.monthlyBuyRemaining|currency:'':2}} {{limits.currency}})
-
+
Daily sell limit: {{limits.dailySell|currency:'':2}} {{limits.currency}} (remaining {{limits.dailySellRemaining|currency:'':2}} {{limits.currency}}) diff --git a/www/views/confirm.html b/www/views/confirm.html index 72a3ba8bd..7a4cd45e4 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -14,8 +14,8 @@ Sending Sending maximum amount - Buying - Selling + Buying + Selling
{{displayAmount || '...'}} {{displayUnit}}
@@ -30,7 +30,8 @@
To - From + From + To @@ -56,8 +57,8 @@
From - To - From + To + From
@@ -79,7 +80,7 @@ {{fee || '...'}}
-