From 258282aefbd1c1fa1a8433040a79a2b516794663 Mon Sep 17 00:00:00 2001 From: rsteimen Date: Fri, 24 Feb 2023 14:07:09 +0100 Subject: [PATCH] chg: hide transfer fee label if none is present --- .../cryptoledger/xrpl/TrustlineInfoProvider.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/radynamics/dallipay/cryptoledger/xrpl/TrustlineInfoProvider.java b/src/main/java/com/radynamics/dallipay/cryptoledger/xrpl/TrustlineInfoProvider.java index 529eb50c..53df862e 100644 --- a/src/main/java/com/radynamics/dallipay/cryptoledger/xrpl/TrustlineInfoProvider.java +++ b/src/main/java/com/radynamics/dallipay/cryptoledger/xrpl/TrustlineInfoProvider.java @@ -23,11 +23,15 @@ public WalletInfo[] list(Wallet wallet) throws WalletInfoLookupException { var list = new ArrayList(); for (var o : trustlineCache.get(WalletConverter.from(wallet))) { - var limitText = MoneyFormatter.formatFiat(o.getLimit()); + var sb = new StringBuilder(); var ccy = o.getLimit().getCcy(); + sb.append(String.format("%s (%s)", ccy.getCode(), toText(ccy.getIssuer()))); + sb.append(", limit: " + MoneyFormatter.formatFiat(o.getLimit())); var transferFeeText = CurrencyFormatter.formatTransferFee(ccy); - var value = String.format("%s (%s), limit: %s, transfer fee: %s", ccy.getCode(), toText(ccy.getIssuer()), limitText, transferFeeText); - list.add(new WalletInfo(this, "", value, 50)); + if (transferFeeText.length() > 0) { + sb.append(", transfer fee: " + transferFeeText); + } + list.add(new WalletInfo(this, "", sb.toString(), 50)); } return list.toArray(new WalletInfo[0]);