Merge pull request #5349 from cmgustavo/bug/top-up-card-amount-01

BitPay card: Fix value in USD on confirm view
This commit is contained in:
Gabriel Edgardo Bazán 2016-12-27 17:25:54 +02:00 committed by GitHub
commit 94a18a9345
3 changed files with 10 additions and 4 deletions

View file

@ -283,6 +283,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
}
var stateParams = {
cardId: $scope.cardId,
cardAmountUSD: amountUSD,
toName: $scope.toName,
toAmount: payProDetails.amount,
toAddress: payProDetails.toAddress,

View file

@ -31,6 +31,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
var isWallet = data.stateParams.isWallet || 'false';
$scope.isWallet = (isWallet.toString().trim().toLowerCase() == 'true' ? true : false);
$scope.cardId = data.stateParams.cardId;
$scope.cardAmountUSD = data.stateParams.cardAmountUSD;
$scope.toAddress = data.stateParams.toAddress;
$scope.toName = data.stateParams.toName;
$scope.toEmail = data.stateParams.toEmail;
@ -132,9 +133,13 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$scope.amountStr = txFormatService.formatAmountStr(toAmount);
$scope.displayAmount = getDisplayAmount($scope.amountStr);
$scope.displayUnit = getDisplayUnit($scope.amountStr);
txFormatService.formatAlternativeStr(toAmount, function(v) {
$scope.alternativeAmountStr = v;
});
if ($scope.cardAmountUSD) {
$scope.alternativeAmountStr = $filter('formatFiatAmount')($scope.cardAmountUSD) + ' USD';
} else {
txFormatService.formatAlternativeStr(toAmount, function(v) {
$scope.alternativeAmountStr = v;
});
}
if ($scope.isGlidera == 'buy') $scope.getBuyPrice();
if ($scope.isGlidera == 'sell') $scope.getSellPrice();
};

View file

@ -1031,7 +1031,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
})
.state('tabs.bitpayCard.confirm', {
url: '/confirm/:cardId/:toAddress/:toName/:toAmount/:toEmail/:description',
url: '/confirm/:cardId/:cardAmountUSD/:toAddress/:toName/:toAmount/:toEmail/:description',
views: {
'tab-home@tabs': {
controller: 'confirmController',