Skip to content

Commit

Permalink
Addresses issues mentioned in #3482 (comment) (#3496)
Browse files Browse the repository at this point in the history
  • Loading branch information
ripcurlx authored and sqrrm committed Oct 28, 2019
1 parent 07c6264 commit bc2ca8d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
15 changes: 11 additions & 4 deletions desktop/src/main/java/bisq/desktop/components/PeerInfoIcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,19 @@ private PeerInfoIcon(NodeAddress nodeAddress,
getChildren().addAll(outerBackground, innerBackground, avatarImageView, tagPane, numTradesPane);

boolean needsSigning = PaymentMethod.hasChargebackRisk(offer.getPaymentMethod(), offer.getCurrencyCode());
String accountSigningState = Res.get("shared.notSigned.noNeed");
String accountSigningState = null;
String accountAgeInfo = peersAccount.second;

if (needsSigning) {
accountSigningState = StringUtils.capitalize(accountAgeWitnessService.getSignState(offer).getPresentation());
AccountAgeWitnessService.SignState signState = accountAgeWitnessService.getSignState(offer);
accountSigningState = StringUtils.capitalize(signState.getPresentation());

if (signState.equals(AccountAgeWitnessService.SignState.UNSIGNED))
accountAgeInfo = null;
}

addMouseListener(numTrades, privateNotificationManager, offer, preferences, formatter, useDevPrivilegeKeys,
isFiatCurrency, peersAccount.first, peersAccount.second, accountSigningState);
isFiatCurrency, peersAccount.first, accountAgeInfo, accountSigningState);
}

private Tuple2<Long, String> getPeersAccountAge(@Nullable Trade trade, @Nullable Offer offer) {
Expand Down Expand Up @@ -285,7 +291,8 @@ protected void addMouseListener(int numTrades,
long makersAccountAge,
String makersAccountAgeInfo,
String accountSigningState) {
final String accountAgeTagEditor = isFiatCurrency ?

final String accountAgeTagEditor = isFiatCurrency && makersAccountAgeInfo != null ?
makersAccountAge > -1 ?
DisplayUtils.formatAccountAge(makersAccountAge) :
Res.get("peerInfo.unknownAge") :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,15 @@ private void addContent() {
GridPane.setColumnSpan(addCompactTopLabelTextField(gridPane, ++rowIndex,
Res.get("peerInfo.nrOfTrades"),
numTrades > 0 ? String.valueOf(numTrades) : Res.get("peerInfo.notTradedYet")).third, 2);
if (accountAge != null) {
GridPane.setColumnSpan(addCompactTopLabelTextField(gridPane, ++rowIndex, accountAgeInfo, accountAge).third, 2);
}

if (accountSigningState != null) {
GridPane.setColumnSpan(addCompactTopLabelTextField(gridPane, ++rowIndex, Res.get("shared.accountSigningState"), accountSigningState).third, 2);
}

if (accountAge != null) {
GridPane.setColumnSpan(addCompactTopLabelTextField(gridPane, ++rowIndex, accountAgeInfo, accountAge).third, 2);
}

inputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("peerInfo.setTag"));
GridPane.setColumnSpan(inputTextField, 2);
Map<String, String> peerTagMap = preferences.getPeerTagMap();
Expand Down

0 comments on commit bc2ca8d

Please sign in to comment.