Merge pull request #145 from Bitcoin-com/wallet/task/319

Wallet/task/319
This commit is contained in:
Jean-Baptiste Dominguez 2018-05-25 11:50:30 +09:00 committed by GitHub
commit 706ba298fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 9 deletions

View file

@ -205,6 +205,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
}
});
$scope.displayBalanceAsFiat = walletConfig.settings.priceDisplay === 'fiat';
});

View file

@ -13,6 +13,8 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
var currentAddressSocket = {};
var paymentSubscriptionObj = { op:"addr_sub" }
$scope.displayBalanceAsFiat = true;
$scope.requestSpecificAmount = function() {
$state.go('tabs.paymentRequest.amount', {
id: $scope.wallet.credentials.walletId,
@ -212,6 +214,10 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
if ($scope.wallet && walletId == $scope.wallet.id && type == 'NewIncomingTx') $scope.setAddress(true);
})
];
configService.whenAvailable(function(config) {
$scope.displayBalanceAsFiat = config.wallet.settings.priceDisplay === 'fiat';
});
});
$scope.$on("$ionicView.enter", function(event, data) {

View file

@ -72,15 +72,22 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
return item.network == 'livenet';
});
}
var walletList = [];
lodash.each(walletsToTransfer, function(v) {
var displayBalanceAsFiat =
v.status.alternativeBalanceAvailable &&
config.wallet.settings.priceDisplay === 'fiat';
walletList.push({
color: v.color,
name: v.name,
recipientType: 'wallet',
coin: v.coin,
network: v.network,
balanceString: v.cachedBalance,
balanceString: displayBalanceAsFiat ?
v.status.totalBalanceAlternative + ' ' + v.status.alternativeIsoCode :
v.cachedBalance,
getAddress: function(cb) {
walletService.getAddress(v, false, cb);
},