From 8a3e50f1d9f8193e08d966dda9ebfe00655b609f Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 9 Oct 2023 13:23:47 -0400 Subject: [PATCH] fix updating price indicator when price is N/A --- .../desktop/main/presentation/MarketPricePresentation.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/desktop/src/main/java/haveno/desktop/main/presentation/MarketPricePresentation.java b/desktop/src/main/java/haveno/desktop/main/presentation/MarketPricePresentation.java index 35be3289..f33e4b81 100644 --- a/desktop/src/main/java/haveno/desktop/main/presentation/MarketPricePresentation.java +++ b/desktop/src/main/java/haveno/desktop/main/presentation/MarketPricePresentation.java @@ -124,7 +124,11 @@ public class MarketPricePresentation { marketPriceBinding = EasyBind.combine( marketPriceCurrencyCode, marketPrice, - (currencyCode, price) -> CurrencyUtil.getCurrencyPair(currencyCode) + ": " + price); + (currencyCode, price) -> { + MarketPrice currentPrice = priceFeedService.getMarketPrice(currencyCode); + String currentPriceStr = currentPrice == null ? Res.get("shared.na") : FormattingUtils.formatMarketPrice(currentPrice.getPrice(), currencyCode); + return CurrencyUtil.getCurrencyPair(currencyCode) + ": " + currentPriceStr; + }); marketPriceBinding.subscribe((observable, oldValue, newValue) -> { if (newValue != null && !newValue.equals(oldValue)) {