fix updating price indicator when price is N/A

This commit is contained in:
woodser 2023-10-09 13:23:47 -04:00
parent f2a89108e8
commit 8a3e50f1d9

View File

@ -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)) {