diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js
index 6ec1d9469..fc92a2287 100644
--- a/src/js/controllers/confirm.js
+++ b/src/js/controllers/confirm.js
@@ -205,6 +205,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
}
});
+ $scope.displayBalanceAsFiat = walletConfig.settings.priceDisplay === 'fiat';
+
});
diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js
index 95f9a6610..c9fa46de9 100644
--- a/src/js/controllers/tab-receive.js
+++ b/src/js/controllers/tab-receive.js
@@ -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) {
diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js
index 65077995f..29f1749cb 100644
--- a/src/js/controllers/tab-send.js
+++ b/src/js/controllers/tab-send.js
@@ -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);
},
diff --git a/src/js/directives/walletSelector.js b/src/js/directives/walletSelector.js
index 256a2c20d..79053f812 100644
--- a/src/js/directives/walletSelector.js
+++ b/src/js/directives/walletSelector.js
@@ -11,7 +11,8 @@ angular.module('copayApp.directives')
show: '=walletSelectorShow',
wallets: '=walletSelectorWallets',
selectedWallet: '=walletSelectorSelectedWallet',
- onSelect: '=walletSelectorOnSelect'
+ onSelect: '=walletSelectorOnSelect',
+ displayBalanceAsFiat : '=walletSelectorDisplayBalanceAsFiat'
},
link: function(scope, element, attrs) {
scope.hide = function() {
diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js
index 068c3b2ae..dac88169f 100644
--- a/src/js/services/profileService.js
+++ b/src/js/services/profileService.js
@@ -932,8 +932,17 @@ angular.module('copayApp.services')
x.txid = x.data ? x.data.txid : null;
x.types = [x.type];
- if (x.data && x.data.amount)
+ if (x.data && x.data.amount) {
+ // Default to showing amount in crypto because we have that now
x.amountStr = txFormatService.formatAmountStr(x.wallet.coin, x.data.amount);
+ configService.whenAvailable(function(config) {
+ if (config.wallet.settings.priceDisplay === "fiat") {
+ txFormatService.formatAlternativeStr(x.wallet.coin, x.data.amount, function(formattedString) {
+ x.amountStr = formattedString;
+ });
+ }
+ });
+ }
x.action = function() {
// TODO?
diff --git a/www/views/confirm.html b/www/views/confirm.html
index 8bed9035f..443043d49 100644
--- a/www/views/confirm.html
+++ b/www/views/confirm.html
@@ -131,7 +131,8 @@
wallet-selector-wallets="wallets"
wallet-selector-selected-wallet="wallet"
wallet-selector-show="walletSelector"
- wallet-selector-on-select="onWalletSelect">
+ wallet-selector-on-select="onWalletSelect"
+ wallet-selector-display-balance-as-fiat="displayBalanceAsFiat">
diff --git a/www/views/includes/walletSelector.html b/www/views/includes/walletSelector.html
index a53d1c7f1..755331a06 100644
--- a/www/views/includes/walletSelector.html
+++ b/www/views/includes/walletSelector.html
@@ -2,7 +2,8 @@
+ ng-init="wallet.coin == 'btc' ? walletsBtc.push(wallet) : walletsBch.push(wallet)">
+
- {{wallet.status.totalBalanceStr}} + {{wallet.status.totalBalanceAlternative}} {{wallet.status.alternativeIsoCode}} + {{wallet.status.totalBalanceStr}} [Balance Hidden] @@ -113,6 +114,7 @@ wallet-selector-wallets="wallets" wallet-selector-selected-wallet="wallet" wallet-selector-show="showWallets" - wallet-selector-on-select="onWalletSelect"> + wallet-selector-on-select="onWalletSelect" + wallet-selector-display-balance-as-fiat="displayBalanceAsFiat">