From e4d51007530873d3496e6f21e577cacc4d0a5955 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 22 May 2018 19:29:57 -0700 Subject: [PATCH] Initial change for displaying fiat in "Recent Transactions". Does not yet display loading UI. --- src/js/services/profileService.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 068c3b2ae..ecf761b53 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -932,8 +932,19 @@ angular.module('copayApp.services') x.txid = x.data ? x.data.txid : null; x.types = [x.type]; - if (x.data && x.data.amount) - x.amountStr = txFormatService.formatAmountStr(x.wallet.coin, x.data.amount); + if (x.data && x.data.amount) { + x.amountStr = null; // Will have loading state in view + configService.whenAvailable(function(config) { + if (config.wallet.settings.priceDisplay === "fiat") { + txFormatService.formatAlternativeStr(x.wallet.coin, x.data.amount, function(formattedString) { + x.amountStr = formattedString; + // Will I need an apply() after this? + }); + } else { + x.amountStr = txFormatService.formatAmountStr(x.wallet.coin, x.data.amount); + } + }); + } x.action = function() { // TODO?