Fix currency
This commit is contained in:
parent
ce8c8d41fc
commit
f6d7a50b00
5 changed files with 9 additions and 30 deletions
|
|
@ -184,7 +184,6 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
|||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$scope.cardId = data.stateParams.id;
|
||||
$scope.currency = bitpayCardService.getAvailableCurrency();
|
||||
|
||||
if (!$scope.cardId) {
|
||||
$ionicHistory.nextViewOptions({
|
||||
|
|
@ -204,6 +203,7 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
|||
self.balance = cards[0].balance;
|
||||
self.currencySymbol = cards[0].currencySymbol;
|
||||
self.updatedOn = cards[0].updatedOn;
|
||||
self.currency = cards[0].currency;
|
||||
}
|
||||
self.update();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -91,28 +91,17 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
|
|||
}
|
||||
$scope.onWalletSelect($scope.wallets[0]); // Default first wallet
|
||||
|
||||
var currencyCode = bitpayCardService.getAvailableCurrency();
|
||||
var code;
|
||||
switch(currencyCode) {
|
||||
case 'EUR':
|
||||
$scope.currencySymbol = '€';
|
||||
break;
|
||||
case 'GBP':
|
||||
$scope.currencySymbol = '£';
|
||||
break;
|
||||
default : $scope.currencySymbol = '$';
|
||||
};
|
||||
bitpayCardService.getRates(currencyCode, function(err, data) {
|
||||
if (err) $log.error(err);
|
||||
$scope.rate = data.rate;
|
||||
});
|
||||
|
||||
bitpayCardService.get({ cardId: cardId, noRefresh: true }, function(err, card) {
|
||||
if (err) {
|
||||
showErrorAndBack(null, err);
|
||||
return;
|
||||
}
|
||||
$scope.cardInfo = card[0];
|
||||
bitpayCardService.setCurrencySymbol($scope.cardInfo);
|
||||
bitpayCardService.getRates($scope.cardInfo.currency, function(err, data) {
|
||||
if (err) $log.error(err);
|
||||
$scope.rate = data.rate;
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue